Look at the following code. When I try to call a click event from within a menu event, it won't let me. What am I doing wrong?
-- Ethan --VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim openFileDialog1 As New OpenFileDialog() OpenFileDialog1.Filter = "All files (*.*)|*.*" If openFileDialog1.ShowDialog() = DialogResult.OK Then MsgBox("worked!") End If End Sub Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click Call Button1_Click() End Sub




Reply With Quote