Getting a button's code to run programatically

Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Sep 2006
Posts: 88
Reputation: bajanpoet is an unknown quantity at this point 
Solved Threads: 0
bajanpoet bajanpoet is offline Offline
Junior Poster in Training

Getting a button's code to run programatically

 
0
  #1
Sep 12th, 2007
I have a button that when pressed displays all the customers in the table. Other buttons are used to add or delete a customer record, or upload a batch of numbers. How can I fire the Click event of the View button after the Add or Delete buttons code has been executed? For example, this is the code for the Upload button

  1. Private Sub btnImport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnImport.Click
  2. AddBatch(LocationCode, filename)
  3. BuildScript()
  4. SaveScript()
  5. UploadScript()
  6. End Sub

I want the code that is in my view button to execute after my UploadScript() Sub. Any ideas?
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 160
Reputation: kb.net is an unknown quantity at this point 
Solved Threads: 26
kb.net's Avatar
kb.net kb.net is offline Offline
Junior Poster

Re: Getting a button's code to run programatically

 
0
  #2
Sep 12th, 2007
Hi,

Add the below code within your sub where xxx is the name of the button you want to click:
xxx.PerformClick()
It is never about the number of languages you know, you either have the logic of programming or you don't ...

Some of the codes I post are collected from different sites during the past couple of years, so I would like to thank them for their help and for enabling me to help.
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 88
Reputation: bajanpoet is an unknown quantity at this point 
Solved Threads: 0
bajanpoet bajanpoet is offline Offline
Junior Poster in Training

Re: Getting a button's code to run programatically

 
0
  #3
Sep 12th, 2007
Perfect! Thanks a lot!
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC