Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2007-03-27
3
Medium Priority
?
238 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 500 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

688 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