|
-
May 15th, 2010, 04:18 PM
#1
Thread Starter
Hyperactive Member
Call Click Event
How can I call the Click even of a button from somewhere else in code?
-
May 15th, 2010, 04:31 PM
#2
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
May 15th, 2010, 04:45 PM
#3
Thread Starter
Hyperactive Member
Re: Call Click Event
Thanks. Is it the same for other controls too, like the PictureBox?
What about other evens like DoubleClick?
How is this different from the RaiseEvent word?
-
May 15th, 2010, 04:47 PM
#4
Re: Call Click Event
RaiseEvent can only be used on class events that are not inherited.
For other events, you could try calling the event handler:
Code:
PictureBox1_DoubleClick(Me.PictureBox1,EventArgs.Empty)
-
May 15th, 2010, 06:46 PM
#5
Re: Call Click Event
Calling the event handler isn't a good idea IMHO... if the control has a click event that can be handled, use the .PerformClick method. If you are performing actions in a click event of something that could be called outside of that click event, then perhaps that code should be in a sub that CAN be called directly, and then the event handler calls that sub.
-tg
-
May 15th, 2010, 07:02 PM
#6
Re: Call Click Event
Why ever not? Besides, that's for the DoubleClick, etc. events.
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
|