I have a few bits of code in a few subroutines. One of them is like this:
Private Sub RestartExplorer(ByVal sender As System.Object, ByVal e As System.EventArgs)
System.Diagnostics.Process.Start("tskill.exe", "explorer")
System.Diagnostics.Process.Start("explorer.exe")
End Sub
Now, when a user clicks a button, I want it to execute that sub. So when I double-click the button in the form editor and type 'RestartExplorer()', it tells me something about "Argument not specified for parameter 'e' of 'Private Sub RestartExplorer(sender As Object, e As System.EventArgs)". If I remove that whole "ByVal sender" stuff, it works, but then the function cant be called in the context menu for the tray icon. How can I call this function while keeping the "ByVal sender" stuff? :wacko:
Question
Diffused Mind
I have a few bits of code in a few subroutines. One of them is like this:
Private Sub RestartExplorer(ByVal sender As System.Object, ByVal e As System.EventArgs) System.Diagnostics.Process.Start("tskill.exe", "explorer") System.Diagnostics.Process.Start("explorer.exe") End SubNow, when a user clicks a button, I want it to execute that sub. So when I double-click the button in the form editor and type 'RestartExplorer()', it tells me something about "Argument not specified for parameter 'e' of 'Private Sub RestartExplorer(sender As Object, e As System.EventArgs)". If I remove that whole "ByVal sender" stuff, it works, but then the function cant be called in the context menu for the tray icon. How can I call this function while keeping the "ByVal sender" stuff? :wacko:
Link to comment
Share on other sites
7 answers to this question
Recommended Posts