Public Class Commands
Public Sub OpenFile(ByVal AFileName As String)
Dim psi As New ProcessStartInfo()
psi.UseShellExecute = True
psi.FileName = AFileName
Process.Start(psi)
End Sub
End Class
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim fileName As String
Dim Commands As New Commands
If RadioButton1.Checked = True Then
fileName = "c:\test_3\johnson.pdf"
End If
If RadioButton2.Checked = True Then
' Else
fileName = "c:\test_3\ross.pdf"
End If
MessageBox.Show("File name is: " + fileName)
Commands.OpenFile()
End Sub
End Class
The following code causes the error:Commands.OpenFile()
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE