You have only one key on the keyboard so that's why you are getting the same value. You can check for caps lock like this: Control.IsKeyLocked(Keys.CapsLock) and extract information about shift button from e.Keydata. Based on these two pieces of information you will be able to determine whether 'q' was typed or 'Q'
KeyDown/KeyUp events offer a KeyEventArgs with amongst others these key information properties:
· Keys KeyCode: the keyboard code
· Keys KeyData: the key data (i.e. the key that was pressed, combined with
modifier flags that indicate which combination of CTRL, SHIFT, and ALT
keys was pressed at the same time.)
· int KeyValue: the integer representation of the KeyCode property
KeyPress events offer a KeyPressEventArgs with amongst others these key information properties:
· char KeyChar: the character (with correct casing)
The KeyPress event is not raised by noncharacter keys; however, the noncharacter keys do raise the KeyDown and KeyUp events.
The typical use would be to process KeyDown to handle special keys (such as Enter, Backspace,
and CTRL/X combinations), and to process KeyPress to consume regular keys (as in adding
characters to text)
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
Application_End gets called when the application ends, i.e. when the worker process that is running it terminates. To test it's working, put some code in it to write to the event log and then recycle IIS using iisreset.
Deja View - the feeling that you've seen this post before.
file.Document.DTE.Find.Action = vsFindAction.vsFindActionFind; //vsFindActionReplace;
file.Document.DTE.Find.FindWhat = line; //line is my text
//file.Document.DTE.Find.ReplaceWith = TmpLine; // is my new text
file.Document.DTE.Find.Target = vsFindTarget.vsFindTargetSolution;
file.Document.DTE.Find.MatchInHiddenText = true; // default on.
vsFindResult tmp = file.Document.DTE.Find.Execute();
i would like to ask what is the most suitable method for creating chat rooms , to use multicast or unicast methodology ?
and if it is multicast how can i assign a globally reachable multicast address for the server machine
knowing that yahoo uses unicasting in chat rooms ?
uuuh , Yahoo guys are incredible , what about the overhead on the servers , how could they solve it ?
You can respond to the columnclick event and show context menu but the problem is that the event occurs when left button is clicked and not the right one. You will also have to figure out where to show context menu.
I have a huge problem,i am trying to edit values from gridview and am not using adit command of gridview i want to use stand alone button and inside my gridview i have a checkbox this checkbox when checked on a certain line only that line on a gridview must change to editable mode when i click my stand alone edit button. i.e more like when you have mail on yahoo or anymail if you want to delete a message you check the checkbox and then click delete button so am looking something like that
You could for instance set the various columns, except your checkbox column, to readonly. Then when you click your editbutton, extract ticked DataRow and edit the data in a custom control. Or set all DataRows.ReadOnly property to 'true' except the ticked one. You could do this in the DataGridView.CellValueChanged event handler.