RSS Forums RSS

Getting a button's code to run programatically

Please support our VB.NET advertiser: DiscountASP.NET – 3 Months Free on VB.NET Web Hosting
Thread Solved
Reply
Posts: 86
Reputation: bajanpoet is an unknown quantity at this point 
Solved Threads: 0
bajanpoet bajanpoet is offline Offline
Junior Poster in Training

Question Getting a button's code to run programatically

  #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

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

I want the code that is in my view button to execute after my UploadScript() Sub. Any ideas?
AddThis Social Bookmark Button
Reply With Quote  
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

  #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  
Posts: 86
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

  #3  
Sep 12th, 2007
Perfect! Thanks a lot!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Views: 1925 | Replies: 2 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 3:30 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC