Solved

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

Posted on 2007-03-27
3
223 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

735 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