|
Did you cast it to char as I showed in the example?
|
|
|
|
|
Thank you so much for that sir.. It works.. Sir, how can i can assign a hotkey to a Button?.. Ahm, for example.. I want a Button_Click event to be associated with a shortcut key.. Instead of me Pressing the Button itself, i just have to press a key from the keyboard.. like; Pressing the F2 key to be associated with
the Event of a Click of a Button.. Im really sorry for this sir.. I ask a lot of questions. I'm just new to C#, and I'm only a student.
|
|
|
|
|
if (e.KeyChar == (char)Keys.F2)
Button_Click(null,EventArgs.Empty)
|
|
|
|
|
Sir, i appreciate it so much.. Thank you very much for all the help that you have lend me.. Thank you so much sir..
|
|
|
|
|
You are welcome
|
|
|
|
|
Sir, thank you so much for all the help that you lend me.. .. until next time sir..
|
|
|
|
|
Hi,
for printable characters (letters, digits, punctuation) you should use the KeyPress event;
its event arg provides a KeyChar property which is a char, so don't compare it to
(char)Keys.A instead compare it to 'a' or 'A'.
special characters (escape, enter, ...) don't fire the KeyPress event; you should use
the KeyDown (possibly KeyUp) event for these; its event arg provides a KeyCode property
which is a Keys, so that one you can compare to Keys.Escape and others.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
For the specific cases of Enter and Escape there's an easier solution. The AcceptButton and CancelButton properties of the form can be given an event handler as a value (the buttons click handler).
--
If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.
|
|
|
|
|
disable hotkeys ctrl, alt,del,win through c# and then enable code
tahir
|
|
|
|
|
I've already replied to your first post which is the same as this one. It is rude to ask the same question twice. I have given a direction to explore, if you are lazy no one will do the work for you
|
|
|
|
|
The veteran poster had also tried to start up this elite discussion thread in a rated PG non-programming forum (aka) Lounge.
|
|
|
|
|
Don't Cross Post and repost.
SSK.
|
|
|
|
|
I have a project developed in 2.0 Framework, can i use a Forum which is developed in 1.1 Framework.
Please suggest is there any problem to integrate the forum.
Thanks in advance
Arun Kr.
Arun Kr
|
|
|
|
|
Kumar Arun wrote: I have a project developed in 2.0 Framework, can i use a Forum which is developed in 1.1 Framework.
Can you use source code from a .NET 1.1 project? Sure. Most of the .NET 2.0 BCL is backwards compatible, but there are breaking changes.
Can you use a .NET 1.1 compiled assembly in your .NET 2.0 project?? Most likely not, but only if the .NET 1.1 assembly MUST use the .NET 1.1 CLR. If this is the case, then no, you can't use the assembly because you cannot load two different versions of the .NET CLR into the same process.
If the .NET 1.1 assembly will work fine running under the .NET 2.0 CLR, then yes, you can use it.
But, like I said, there ARE breaking changes between .NET 1.1 and .NET 2.0 and above.
|
|
|
|
|
i want to get start menu programs in a listbox of my application
tahir
|
|
|
|
|
You can iterate over the files and folders in these folders to extract the information you need:
C:\Documents and Settings\All Users\Start Menu\Programs
and
C:\Documents and Settings\%username%\Start Menu\Programs
|
|
|
|
|
In WinForm Project.
I want to touch off keyboard's event and capture "Ctrl+Enter" in a Form.
How to do?
|
|
|
|
|
You can handle the Keypress event and check for the modifiers and keys that are pressed
|
|
|
|
|
Which part is the article in, Applications,Beginners or General?
I didnot find it.
|
|
|
|
|
It's not in my articles, it's just a signature. Form class has a KeyDown event which receives KeyEventArgs type parameter. You can check its Control property to determine if CTRL is down or modifiers property and also examine the KeyData property.
|
|
|
|
|
I try and judge the keys,but i am failure.
I donot know how to write the "if" language yet.
|
|
|
|
|
In that case you should first learn c# syntax
|
|
|
|
|
I apprehend it is "if(e.KeyCode == Keys.Enter && e.Modifiers == Keys.Control)".
But it is unsuccessful.
|
|
|
|
|
Keydown is fired twice: once for control key and once for Enter so you can't test it in one piece of code. Instead use keydown and keyup events to toggle a boolean value which shows if CTRL key is down and for enter key and this value
|
|
|
|
|
hi,
How do i insert new objects like Trackbar to the Built-In Column Types in DataGrid?
there are only the options TextBox,Button,Link and CheckBox..
|
|
|
|