我用PictureBox控件装了一个label标签控件,我想在点击了label控件后,弹出已定义好的菜单:
PopupMenu lby, ,  x,  y
但弹出的菜单不在鼠标指针的位置,而是在Form窗体的左上角,怎么才能使鼠标弹出在鼠标指针所在的位置?

解决方案 »

  1.   

    Private Sub Label1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
        PopupMenu mnuTest, , X + Picture1.Left + Label1.Left, Y + Picture1.Top + Label1.Top
    End Sub
      

  2.   

    PopupMenu lby, , X + Picture1.Left + Label1.Left, Y + Picture1.Top + Label1.Top
      

  3.   

    PopupMenu lby ' 后面不要, ,  x,  y
      

  4.   

    Private Sub CeHFlex_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
      If Button = 2 Then
        PopupMenu MnuMenu
      End If
    End Sub