|
I am trying to call the event OnHelpButtonClicked.
I am unsure of how to get it to work. I am using the following code:
private void button1_Click(object sender, EventArgs e)
{
CancelEventArgs Arg1 = new CancelEventArgs();
Arg1.Cancel = false;
OnHelpButtonClicked(Arg1);
}
|
|
|
|
|
Hello,
The question is not clear at all, I think.
But if you have a button on your form, which is named HelpButton, you could use the PerformClick[^] method of the Button.
HelpButton.PerformClick();
If you mean the Help funktionality "F1", you could use SendKeys.Send[^]
SendKeys.Send("{F1}");
Hope it helps!
All the best,
Martin
|
|
|
|
|
I don't think I have made myself clear. I am trying to use the Help Button that can be added to the title bar of a window, the problem with using it in the title bar of the window is that you have to remove Max and Min window (as seen here http://davidkean.net/images/helpwindow.jpg).
What I would like to do is link this Help Button to a button that I have created on my form. Thus the following code.
CancelEventArgs Arg1 = new CancelEventArgs();
Arg1.Cancel = false;
OnHelpButtonClicked(Arg1);
The problem is when I call this nothing happens, I know it is getting into the OnHelpButtonClicked function (as I override the function) but it does nothing when it enters the base.OnHelpButtonClicked.
Thanks for the help.
PS I tried the HelpButton.PerformClick(); and it does not have it
|
|
|
|
|
Just add a little more information into this, I now am starting to think that I am not overriding the right function as when I override the OnHelpButtonClicked and remove the base class it still works.
|
|
|
|
|
Ok,
Now I understand your problem.
I tried it with SendKeys, and it opens the help!
All the best,
Martin
|
|
|
|
|
I have a c#.net project that I am working on. I made a gridview object and an XMLdatasource object and I bound the xml data to the grid view. So the gridview shows all the States from the XML File.
I am trying to add a simple search on this data with a textbox. This textbox is calling a textchanged function on each keystoke. Inside this textchange function i was trying to dynamically search the XML data and display only the States that contain the same as the textbox or start with or end with the text that is in the text box.
I dont know how i can dynamically update the gridview. Any advice will be helpful.
Craig <state name="Tennessee">
<state name="Texas">
<state name="Utah">
<state name="Vermont">
<state name="Virgin Islands">
<state name="Virginia">
<state name="Washington">
<state name="West Virginia">
<state name="Wisconsin">
<state name="Wyoming">
I dont know how i can dynamically update the gridview. Any advice will be helpful.
Craig
|
|
|
|
|
Are you using Xpath to retrieve the filtered nodes?
Visit my blog at http://dotnetforeveryone.blogspot.com/
|
|
|
|
|
In the Win32 API, it's possible to easily encrypt data that can only be decrypted by the same user on the same machine. The data cannot be shared among different installations of Windows, or other users on the same installation.
The function that does this is CryptProtectData() .
Does the .NET Framework offer a way to place the same restrictions on encrypted data?
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
With p/invoke, you can call any Win32 API you like. Try www.pinvoke.net[^] to see if they have the signature for that method.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Yes, thank you. That is a viable option, but are you saying that there is no comparable method in .NET, or that you are not aware of one?
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
I really don't know.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
have you considered using the Enterprise Library Crytopgraphy Application Block.
From memory, it does generate a key based on the User's credentials. Then this key can be used to decrpty or encrypt information as desired.
Take a look at this article: http://davidhayden.com/blog/dave/archive/2006/03/04/2874.aspx
|
|
|
|
|
Thanks for the reply. I'll take a look!
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
I have a program that is semitransparent and is topmost. If a different program has focus, the keyboard messages reach it (the other program) just fine, but my topmost form intercepts mouse input (understandably so). How can I make my program take all mouse input and resend it through Windows's message pool so that it's as if my program wasn't there? I want to be able to function in the other active applications as if my program wasn't there (wasn't topmost).
The reason it has to be topmost is because it has a duplicate of the user's background image on it. Being semitransparent, it gives the effect that, instead, all of the other programs are semitransparent (the ultimate goal), so that the user can still faintly see their wallpaper "behind" their programs (because I don't know how to forcefully reduce all other programs' opacity).
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
My shameless plug[^] on click-through forms.
You can't force another app's window to be opaque. You have no control over how another app paints it's windows. On top of that, what you have to do to the window to support opacity could very well make the other app's painting code crash.
|
|
|
|
|
I understand that I can't alter how another window paints itself. That's why I needed a click-through-able window.
Your shameless plug is exactly what I needed! (well... after manually converting the VB to C#) However, it wasn't working exactly 100%. I took out the lines that changed [myform].Opacity and it seems to be working just fine now (using SetLayeredWindowAttributes instead of Form.Opacity).
Thank you!
I now have a wallpaper that seems to "show through" all of my windows (as if all of my windows were semitransparent)!
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
Hello everyone,
I have a DataGridView controll which is populated by a table from a remote database. One of the Columns contains images which I am using the following line of code to access the images in the DataGridView.
System.Drawing.Image itemOriginalImage = (Image)dataGridView1.Rows[ItemRowIndex0].Cells["item_image"].FormattedValue;<br />
I wish to remove the DataGridView and replace it with a DataTable. I was wondering how I can access the image column in the DataTable?
I am using this code but I am unable to set the format right.
System.Drawing.Image itemOriginalImage = (Image)myTable.Rows[ItemRowIndex0].ItemArray.GetValue(6).<br />
I get the following error for the above line of code. "Unable to cast object of type 'System.Byte[]' to type 'System.Drawing.Image'."
Can someone be kind enough to tell me how I can access the image in my DataTable?
Thank you very much and have a great day.
Khoramdin
|
|
|
|
|
Use
System.Drawing.Image _image = System.Drawing.Image.FromStream( new System.IO.MemoryStream( (byte[])myTable.Rows[ItemRowIndex0].ItemArray.GetValue(6)) );
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
I have a string strA = "12 MyAddress"
strB = "Your Name"
I want to get the first char of string and want to know weather it is integer between 1-9 or char between A-B.
How can I do that.
seema
|
|
|
|
|
The string class provides a handy little Substring function. You can cast it to a char, and the char class provides functions like IsDigit to help. Have a look at the documentation for these classes to get a clear idea of exactly what you need to do.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
char c = strA[0];
if (c >= '1' && c <= '9') {
} else if (c >= 'A' && c <= 'B') {
}
|
|
|
|
|
In C# or VB.NET ? Please don't crosspost.
You can do this:
if (Char.IsDigit(strA[0]) || strA[0] == 'A' || strA[0] == 'B')
{
}
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Since you have cross-posted in three forums you are being sent to the corner where I will whip you virtually with my Wired magazine until you beg for forgiveness.
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
hi
I got a problem in inserting new rows to a datatable.How can I insert dates in a data table using DB2.
Here is some code...
DB2Connection conn = new DB2Connection(connectionString);
DB2DataAdapter DataAd= new DB2DataAdapter(select, conn);
DataSet ds=new DataSet();
DataAd.Fill(ds, "Table Name");
Datarow dr = ds.Tables["Table Name"].NewRow();
DB2Command aCommand = new DB2Command(select, conn);
aCommand.CommandType = CommandType.Text;
aCommand = new DB2Command("INSERT INTO CL.VSCHTM("ST_DTE")"
"VALUES ("#" + dr["ST_DTE"]+"#",conn);
DataAd.InsertCommand = aCommand;
DataAd.Update(ds, "Table Name");
aCommand.Parameters.Add(new DB2Parameter("ST_DTE",DB2Type.Date, 0, "ST_DTE"));
aCommand.UpdatedRowSource = UpdateRowSource.OutputParameters;
It doesn't add new row ,any help??
kidus
|
|
|
|
|
Is the datetime the min value in .net? There is a chance that db2 doesn't support it. I know sql server does not. I would think if the row doesn't get inserted there must be an error message. Have you tried to do the insert outside of .net to see if it works?
Ben
|
|
|
|