English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have a button named browse, i want to click the button and be able to browse to an exe file (or shortcut file). then the path to the browsed to exe file will be inputed into a text box.
im usin vb.net
thanks
mike

2006-12-18 16:02:02 · 2 answers · asked by Anonymous in Computers & Internet Programming & Design

2 answers

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim mydlg As New OpenFileDialog

On Error GoTo err_handler

With mydlg
.InitialDirectory = "c:\"
.Filter = "exe files (*.exe)|*.exe|All files (*.*)|*.*"
If .ShowDialog = Windows.Forms.DialogResult.OK Then
TextBox1.Text = .FileName.ToString
End If

End With
Exit Sub
err_handler:

End Sub

2006-12-18 17:39:05 · answer #1 · answered by MarkG 7 · 0 0