Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi, i want to execute my subroutine for when a button is clicked on one form when a button on my contextmenu is clicked. I have tried this code but it fails to work

 

Private Sub mnuDefaultCpanel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuDefaultCpanel.Click
       frmCP.cmdLaunch_Click()
   End Sub

 

Thanks for any help you can give

 

Jonathan

  • Administrators
Posted

What is the name of the form this sub is in? If it is frmCP then you could do

either

Private Sub mnuDefaultCpanel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuDefaultCpanel.Click
       cmdLaunch_Click()
   End Sub

or

Private Sub mnuDefaultCpanel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuDefaultCpanel.Click
       Me.cmdLaunch_Click()
   End Sub

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted
its not being excecuted on frmCP anyway i have just made it so that its a subroutine on that form which is then executed by the button subroutine and the other forms subroutine

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...