[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

Triggering an Event

Is there a code to call a sub that is set to handle a given event, such as a button click. Is this possible, can the click event of a given button be triggered, or is there a different way?
0
Lisa0812
Asked:
Lisa0812
1 Solution
 
PaulHewsCommented:
For buttons I usually call the click event sub like this:

Button1_Click(Nothing, Nothing)

If you need the sender parameter, just include the button variable as a parameter to the call.
0
 
WarpsehCommented:
For button click you could also use Button1.PerformClick()
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
The second method is the preferred method as this will cause ALL wired handlers to fire properly.
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now