call private sub and multi threading in vb.net

pvg1975
pvg1975 used Ask the Experts™
on
Hi all,

I have a private sub for a button_click:

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

Is it possible to cal that sub from another button?

I tried

Button4_Click

and Call Button4_Click

but is not working....

Also, the button has a large process, is it possible to keep using the application while the process is taking place? Is that multi threading or something like that, right?

Thanks!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Top Expert 2014
Commented:
You can use

Button4.PerformClick()
Most Valuable Expert 2012
Top Expert 2014

Commented:
You have to move the code to either a separate thread or use a background worker.

http://www.java2s.com/Code/VB/GUI/BackgroundWorkerDemo.htm

Commented:
As suggested above, you can use Button4.PerformClick(). However, that will not be the best way to proceed if you also want to implement threading, and the "out of the box" method, again as suggested above, is the Backgroundworker. I would suggest implementing  a backgroundworker class. Microsoft provide a fantastic walkthrough here: http://msdn.microsoft.com/en-us/library/ywkkz4s1.aspx

Author

Commented:
Thanks!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial