Beginner question

Morpheus

Well-known member
Joined
Jan 18, 2002
Messages
62
I have used VB 6 before but now Im moving to C#.

When you make a textbox in VB 6 the textbox have different events like KeyPress. I cant find anything like that in C#. So how do I do to get my program to respond to KeyPress event?
 
In the properties window, click the little Lightning bolt icon. The
properties list will change to an events list. Type the desired name
of your event sub beside the event you want, and press enter.
It will now add the event handler to your control.
 
While focused on the control in design view, goto the properties window and click on the Lightning-Bolt (Events) then double-click on the event you wish to use.

[edit]beaten to the punch. :( [/edit]
 
Cool!

I wasnt aware of the events button on the properties window. Up until now, Ive always used the code window and its object/procedure drop-down menus to get into the various event handlers.

Thanks,
Shuaib
 
Those arent available in C#. Thats why you do it this way. Likewise,
the event button is not available in VB.NET.
 
Back
Top