Trying to add a double click event :(

glasswizzard

Active member
Joined
Nov 22, 2019
Messages
30
Programming Experience
Beginner
Hi, my program has a second form called frmHistoryForm, how do I add a double click event handler to it? If I double click on it creates a HistoryForm_Load() method, not a double click one.

Any help appreciated :)
Thanks
 
Last edited:

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
2,506
Location
Sydney, Australia
Programming Experience
10+
There are three ways to automatically create event handlers in VB.
  • Double-click a component or control in the designer to create a handler for the default event.
  • In the design window, open the Properties window, click the Events button and then double-click the event of interest. This will handle multiple events with a single method if you have selected multiple controls or components. You can also select an existing event handler in the drop-down for an event.
  • In the code window, use the navigation bar at the top, selecting the desired field in the middle drop-down and the desired event from the right-most drop-down.
 

glasswizzard

Active member
Joined
Nov 22, 2019
Messages
30
Programming Experience
Beginner
Thanks for replying, could you tell me where the Events button is located please? I can't find it in my properties list. I'm using C# not Vb, will that make things different?

Edit: Found it :)
 

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
2,506
Location
Sydney, Australia
Programming Experience
10+
Sorry, I was thinking that I was still in our VB forum when I wrote. I forgot that I had switched to the C# forum. The first two options apply to C# as well but the third one is VB-specific.
 

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
2,506
Location
Sydney, Australia
Programming Experience
10+
could you tell me where the Events button is located please? I can't find it in my properties list.
It's not in the properties list because it's not a property. The Properties window isn't all that big and there are only a few buttons in it, so I think that you can probably find it with a bit of effort.
 
Top Bottom