Jump to content

Call System.EventArgs from other EventArgs using VB.net 2008

- - - - -

  • Please log in to reply
No replies to this topic

#1
AWS

AWS

    Administrator

  • Administrators
  • 54,030 posts
  • LocationJoliet, IL U.S.A.

Good Morning,

i have 03 pictureboxes in a panel & i have created one Click Event handler for them,

now there's a contextmenustrip inside my form with 03 toolstripmenuitem which are related to those 03 pictureboxes, now i want to call those picturebox click events when i click their name, which are on contextmenustrip using vb.net 2008, 

so, how to call 

Private Sub picturebox1_click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles picturebox1.Click, picturebox2.Click, picturebox3.Click

End Sub

from below sub

Private Sub CM_chcS_ItemClicked(ByVal sender As Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles CM_chcS.ItemClicked

         For Each pb As PictureBox In Me.AM_chcPb.Controls.OfType(Of PictureBox)()
            If e.ClickedItem.Text.ToString = ToolTip1.GetToolTip(pb).ToString Then
                Me.chcPwrpb_Click(pb, New System.EventArgs)
            End If
        Next

End Sub

i use 'picturebox1_click(pb, nothing)

i use 'picturebox1_click(pb, New System.EventArgs)

but above mentioned not work anymore for me,

what i do now, please help!


Pl. Mark/Proposed as Answer if found your solution Vote as Helpful if related to your topic. Always Motivate others by performing this Action.


View the full article




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users