944,003 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Marked Solved
  • Views: 5728
  • VB.NET RSS
Sep 12th, 2007
0

Getting a button's code to run programatically

Expand Post »
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

VB.NET Syntax (Toggle Plain Text)
  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?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
bajanpoet is offline Offline
96 posts
since Sep 2006
Sep 12th, 2007
0

Re: Getting a button's code to run programatically

Hi,

Add the below code within your sub where xxx is the name of the button you want to click:
xxx.PerformClick()
Reputation Points: 13
Solved Threads: 29
Junior Poster
kb.net is offline Offline
169 posts
since Aug 2007
Sep 12th, 2007
0

Re: Getting a button's code to run programatically

Perfect! Thanks a lot!
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
bajanpoet is offline Offline
96 posts
since Sep 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Background program that runs straight away
Next Thread in VB.NET Forum Timeline: WrapText in an AxOWC10.AxSpreadsheet Control





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC