Thanks. I know that I shouldnt change the Name property (if I remember correctly thats not possible). I do only need it to create a unique identification string to search that in my text files.
I've tried casting MenuItem back into Control but that gives me a compiler error :/
You shouldn't be casting MenuItem to Control, it should probably be the other direction. The Name property should always be unique (and if you're using the Forms designer it will guarantee that it is) so that should be your key into the text file.
Since you are trying to do localization, is there a reason you aren't using the built-in localization that Windows Forms and .NET provides?
Scott. —In just two days, tomorrow will be yesterday.
I have a RichTextBox.
When I press any alphabetic key on RichTextBox_KeyDown the e.KeyValue have the ascci code for the bigger letter. I press "q" and the e.KeyValue have the ascci code for "Q". How can I detect what key I pressed?
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.