how to link a button in vb.net to a exe file just suggest with the help of the code

Recommended Answers

use on button click,

System .Diagnostics .Process .Start ("notepad.exe")
Jump to Post

All 2 Replies

use on button click,

System .Diagnostics .Process .Start ("notepad.exe")

OK, assuming your form's name is Form1, here is what you need to do:

1. Drag a Button control to your form
2. Double click the button you just placed in order to get to its Click event
3. Type in the following code:

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Process.Start("FileNameGoesHere")
    End Sub
End Class

NOTE: Do NOT forget to add the EXE extension after the name of the executable, else it won't work. For example, for Internet Explorer, it should be Process.Start("iexplore.exe") Remember to mark the thread as solved if that's what you were looking for.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.