 |
|
 |
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid..
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
|
 |
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
|
 |
I have google a lot but i just find Copy Hook Handler (ICopyHook) but didnt know how to use!
i wanna to prevent user from deleting trace.trc file but system can update the info in it.just prevent from deleting it,even if the program is closed soin windows also prevent from deleting .
|
|
|
|
 |
|
 |
I was able to create the effect of gradient in the DataGridView control as shown in the image (White & DarkOrange).
But now can not VISUALIZE THE DATA THAT CONTAINS THE DATAGRIDVIEW.
( Pude crear el efecto de degradado en el control DataGridView como se muestra en la imagen ( White & DarkOrange ) .
Pero ahora no se pueden VISUALIZAR LOS DATOS QUE CONTIENE EL DATAGRIDVIEW )
Example Image[^]
|
|
|
|
 |
|
 |
Your question does not explain enough of what's going on.
How are you trying to "visualize" the data? What seems to be going wrong? Do you receive any exceptions?
What are they?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
 |
|
 |
In the event the datagridview Paint have done the following:
private void dtgData_Paint(object sender, PaintEventArgs e)
{ Graphics g = e.Graphics;
Rectangle rect = new Rectangle(0, 0, Width, Height);
LinearGradientBrush b = new LinearGradientBrush(rect, Color.White, Color.DarkBlue, LinearGradientMode.Vertical);
g.FillRectangle(b, rect);
}
Before creating the gradient showed data from the cube to my database
modified 7 hrs ago.
|
|
|
|
 |
|
 |
the DGV needs to paint itself through its Paint event; if it does not run at all, or runs before your Paint handler runs, then all it will show is your stuff, and not its native capabilities. Either switch the order of the paint handlers, or better yet override OnPaint() and have its handler call base.OnPaint() when the background is done. The details depend on your current setup.
|
|
|
|
 |
|
 |
Sorry I am very new to c# I could explain with an example, thank you very much for your help.
|
|
|
|
 |
|
 |
In order for this to work, you need to have your own DGV class derived from DataGridView, and implement an OnPaint method, which calls base.OnPaint() AFTER you are done with the background.
Here[^] is the relevant MSDN page; the important sentence is
When creating a new custom control or an inherited control with a different visual appearance, you must provide code to render the control by overriding the OnPaint method. For more information, see Overriding the OnPaint Method and Custom Control Painting and Rendering.
and it contains links to more explanation.
IMO you really should study a book on C# and WinForms before trying all this... And then use Google to locate the detailed documentation and some examples.
|
|
|
|
 |
|
 |
hi I am going to apply fuzzy to C #
calculate the linear and triangular membership functions.
http://cdn-u.kaskus.us/72/d162lwot.png[^]
http://cdn-u.kaskus.us/72/7qhhkzn8.png[^]
download an application http://www.4shared.com/rar/wJEK9W45/fuzzy.html[^]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
namespace LATIHAN
{
public partial class fuzzy : DevExpress.XtraEditors.XtraForm
{
Double MU, PA, TU;
public fuzzy()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Double vskor = Convert.ToDouble(textBox1.Text);
if (25 <= vskor && vskor <= 45)
{
MU = (45 - vskor) / (45 - 25);
}
else if( vskor < 25)
{
MU = 1;
}
else
{
MU = 0;
}
if (vskor <= 35 || vskor >= 55)
{
PA = 0;
}
else if (35 <= vskor && vskor <= 45)
{
PA = (vskor - 35) / (45 - 35);
}
else if (45 <= vskor && vskor <= 55)
{
PA = (55 - vskor) / (55 - 45);
}
if (45 <= vskor && vskor <= 65)
{
TU = (vskor - 45) / (65 - 45);
}
else if (vskor <= 45)
{
TU = 0;
}
else
TU = 1;
label1.Text = "MUDA (" + MU + ")";
label2.Text = "PAROBAYA (" + PA + ")";
label3.Text = "TUA (" + TU + ")";
if (TU > MU && TU > PA )
{
hasil.Text = " Ternyata Ahaha anda TUA .. tuaaa tuaaaa :D (" + TU + ")";
}
if (MU > PA && MU > TU)
{
hasil.Text = "Anda termasuk MUDA jadilah anak yang berguna (" + MU + ")";
}
if (PA > MU && PA > TU)
{
hasil.Text = "Anda sudah PAROBAYA jangan salah langkah nanti bisa jadi BAYA (" + PA + ")";
}
}
private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
RamGec_About_Box1 m = new RamGec_About_Box1();
m.Show();
}
}
}
C# fuzzy
|
|
|
|
 |
|
 |
If you're trying to post this for the world to use, write an article on it, don't post it to a forum.
If you're trying to ask a question, you didn't.
|
|
|
|
 |
|
 |
Is there a question you want answered ? Why are you posting this here: what kind of response do you expect to get ?
best, Bill
"Humans are amphibians ... half spirit and half animal ... as spirits they belong to the eternal world, but as animals they inhabit time. This means that while their spirit can be directed to an eternal object, their bodies, passions, and imaginations are in continual change, for to be in time, means to change. Their nearest approach to constancy, therefore, is undulation: the repeated return to a level from which they repeatedly fall back, a series of troughs and peaks.” C.S. Lewis
|
|
|
|
 |
|
 |
I have a client application, which uses a unmanaged dll for communicating with a server.
All network-related operations are perormed inside the unmanaged dll.
After a number of operations with the server, the client is running out of TCP ports.
If we check the state of netwotk using 'netstat -an', we get the following result:
...
TCP 192.168.11.55:56048 192.168.10.28:5000 FIN_WAIT_2
TCP 192.168.11.55:56049 192.168.10.28:5000 FIN_WAIT_2
TCP 192.168.11.55:56050 192.168.10.28:5000 FIN_WAIT_2
TCP 192.168.11.55:56051 192.168.10.27:5000 FIN_WAIT_2
TCP 192.168.11.55:56052 192.168.10.28:5000 FIN_WAIT_2
TCP 192.168.11.55:56053 192.168.10.27:5000 FIN_WAIT_2
TCP 192.168.11.55:56054 192.168.10.27:5000 FIN_WAIT_2
TCP 192.168.11.55:56055 192.168.10.27:5000 FIN_WAIT_2
TCP 192.168.11.55:56056 192.168.10.27:5000 FIN_WAIT_2
TCP 192.168.11.55:56057 192.168.10.28:5000 FIN_WAIT_2
TCP 192.168.11.55:56058 192.168.10.27:5000 FIN_WAIT_2
TCP 192.168.11.55:56059 192.168.10.28:5000 FIN_WAIT_2
TCP 192.168.11.55:56060 192.168.10.27:5000 FIN_WAIT_2
...
The ports are released only after the client is closed.
If I run the VS project in Debug Mode, it never runs out the ports.
But, while running in Release mode, it is happening.
How to release or kill those ports which are in FIN_WAIT_2 state?
|
|
|
|
 |
|
 |
Does Tom Shelton's reply on this[^] page help?
/ravi
|
|
|
|
 |
|
 |
Yes. I know that the server is not sending ACK to the client signaling that the socket is closed.
The problem is I don't have access neither to server nor client code.
The only solution I am seeing here is releasing the ports by force.
In POSIX, there is a system call (linger?) to close ports.
I am looking something like this for Windows, if it exists.
|
|
|
|
 |
|
 |
LingerOption[^] may help. But methinks you'll need access to the client code (at least).
/ravi
|
|
|
|
 |
|
 |
Hi all !
I want to save the DataGrid Cell Value into an excel file :
...
try
{
mySheetInputData = (Microsoft.Office.Interop.Excel.Worksheet)ExWorkBookInputData.Sheets["Sheet1"];
mySheetInputData = (Microsoft.Office.Interop.Excel.Worksheet)ExWorkBookInputData.ActiveSheet;
mySheetInputData.Name = "mySheet";
...
for (int i = 0; i < RowCount; i++)
{
for (int j = 0; j < ColumnCount; j++)
{
mySheet.Cells[i + 2, j + 2] = dgv.Rows[i].Cells[j].Value;
if (dgv.Rows[i].Cells[j].Value == null || dgvRows[i].Cells[j].Value.Equals(""))
mySheet.Cells[i + 2, j + 2] = 0.0;
}
}
dgv.update();
....
when I save this to an excel file , last cell i fill , show the value of "0.0" , but when I resize or minimize the application or change the cursor in the next cell that fill before , there is no problem to show all value i put to DataGrid Cell.
thanks a lot !
modified 2 days ago.
|
|
|
|
 |
|
 |
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Edit your question and provide better information - perhaps a simple example of what you have before, what you expect, and what you get would help.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
 |
|
 |
This is happening because a cell is still in edit mode when it's Value property is read. The new value does not become available until it has been committed and edit mode ended.
As you found out this can be done by moving the focus to another cell or control, but it can also be done programmatically by calling the DataGridView's EndEdit method.
Inserting the following line before you start reading values from the grid should fix the problem.
dgv.EndEdit();
Alan.
|
|
|
|
 |
|
 |
thanks , it solve the problem !
|
|
|
|
 |
|
 |
So I create a new project, planning to use a Grid for layout. According to VS2010 Help, this is found in System.Windows.Controls. I typed the appropriate using clause and added a Grid element to my Form, but that generated an error telling me that no such namespace exists. So I try to add a reference to the project, but there still is no such thing as a namespace called System.Windows.Controls. It's fully documented in Help, of course, and full of useful things, but there is no such thing, if I believe Visual Studio. The help article also mentions that this item is located in the Assembly, PresentationFramework (in PresentationFramework.dll). So I used the Browse tab to search for this dll and add it, too. Found it, but the IDE still claims there is no such thing as a Grid class.
After several hours of screwing with this nonsense, adding and removing using clauses willy nilly, I quit typing it manually and let the Intellisense display its wares. Lo and Behold, there was a Controls selection available under System.Windows, if I slowed down enough to wait for it to display. Typing it directly, exactly as the automated feature typed it, won't work. Is it any wonder that I never finish an app?
The wonder is that I keep trying...
Will Rogers never met me.
|
|
|
|
 |
|
 |
It's just you!
In practice if you look at the help page:
Namespace: System.Windows.Controls
Assembly: PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation It gives the problem away: "Assembly: PresentationFramework" which means it is part of WPF, not WinForms. If you create a WinForms app, then you can't use the Grid Control, as it requires the WPF framework which is XML based.
Depending on what you are trying to do, you might want to use a TableLayoutPanel or Splitter panels instead!
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
 |
|
 |
That's not quite true. You can use the Grid layout in WinForms as you can host WPF content in a WinForm. Whether you'd want to is a different matter.
|
|
|
|
 |
|
 |
I didn't know that! Any links to how? (Not that I want to do it, it would just be for reference)
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
 |
|
 |
You just need to use an ElementHost object. It's under the WPF tab.
|
|
|
|
 |