|
-
Oct 12th, 2005, 05:09 PM
#1
Thread Starter
Frenzied Member
textbox click event
how do I create a textbox click event function in c#? basically, whats the c# equivalent to vb.net's TextBox1_Click().
-
Oct 12th, 2005, 07:22 PM
#2
Sleep mode
Re: textbox click event
this.TEXTBOXNAME.Click += after this click Tab key . It will create a delegate and wires up an event handler .This is one of the features C# has over VB.NET in the IDE.
-
Oct 13th, 2005, 08:40 AM
#3
Fanatic Member
Re: textbox click event
You can also get a list of events in the propertybox in the formdesigner. If you doubleclick the field an eventhandler is created for you.
"so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman
-
Oct 13th, 2005, 12:22 PM
#4
Re: textbox click event
Indeed. If you look closely the eventhandler assignment for controls you double-click on takes place in the Designer generated code section, so while it looks neater in your part of the code it is actually doing exactly the same thing.
Code:
myTextbox.Click += new EventHandler(eventHandler);
void eventHandler(object Sender, EventArgs e)
{
//
}
typed that off the top of the head so case might be a bit wrong
-
Oct 13th, 2005, 09:46 PM
#5
Thread Starter
Frenzied Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|