Solved

Passing the correct parameters to a controls click event vb.net 2003?

Posted on 2007-03-27
3
232 Views
Last Modified: 2010-04-23
Experts, I am trying to execute a controls click procedure from inside another procedure, but I am not sure what to pass as the system.eventargs

For example: what do I pass to the radio buttons click event below to fire it from another procedure?

'Here is the click event I am trying to call from a different sub procedure
 Private Sub Opt_Retail_Export_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Opt_Retail_Export.Click
'Do some code
End sub

'This is what i am trying to do

sub run_radio_clicks
opt_retail_export_click(opt_retail_export, opt_retail_export.performclick)
End Sub
     
   
0
Comment
Question by:tentavarious
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 17

Expert Comment

by:ZeonFlash
ID: 18803187
To fire the click event, you only need to call the PerformClick method on the control....you don't need to call the event handler explicitly.

Sub run_radio_clicks()
      opt_retail_export.PerformClick()
End Sub
0
 

Author Comment

by:tentavarious
ID: 18803219
Ok, thats what I did, I was just curious what would I pass it?
0
 
LVL 17

Accepted Solution

by:
ZeonFlash earned 125 total points
ID: 18803635
The parameters you pass to the function are really only there for your benefit since you're the one calling it.  You can actually send it Nothing as the parameters and it will work fine, as long as you're not depending on the values.  So this:

Button1_Click(Nothing, Nothing)

Is essentially this:

Button1.PerformClick()
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question