请问VB中右键菜单的制作方法,有的都拿出来。
越好的分越高,不够还加!
急~~~!!!

解决方案 »

  1.   

    VERSION 5.00
    Begin VB.Form Form1 
       Caption         =   "Form1"
       ClientHeight    =   3195
       ClientLeft      =   165
       ClientTop       =   735
       ClientWidth     =   4680
       LinkTopic       =   "Form1"
       ScaleHeight     =   3195
       ScaleWidth      =   4680
       StartUpPosition =   3  '窗口缺省
       Begin VB.Menu mnu_file 
          Caption         =   "File"
          Begin VB.Menu mnu_open 
             Caption         =   "Open"
          End
          Begin VB.Menu mnu_bar 
             Caption         =   "-"
          End
          Begin VB.Menu mnu_exit 
             Caption         =   "E&xit"
          End
       End
       Begin VB.Menu mnu_edit 
          Caption         =   "Edit"
          Begin VB.Menu mnu_Copy 
             Caption         =   "Copy"
          End
          Begin VB.Menu mnu_cut 
             Caption         =   "Cut"
          End
       End
    End
    Attribute VB_Name = "Form1"
    Attribute VB_GlobalNameSpace = False
    Attribute VB_Creatable = False
    Attribute VB_PredeclaredId = True
    Attribute VB_Exposed = False
    Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Select Case Button
        Case 2
            PopupMenu mnu_edit
    End Select
    End Sub
      

  2.   

    在窗体的MouseDown事件中设置代码啊!if button =2 then '2是鼠标右键
     popupMenu xxx 'xxx是菜单名称 
    end if
      

  3.   

    上面代码保存为扩展名的.frm的文件即可
      

  4.   

    先在菜单设计器中设置菜单(如:mununame1)
    然后
    Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
       if button =2 then '2是鼠标右键
          popupMenu mununame1
       end ifEnd Sub
      

  5.   

    (完美风暴)提供的不就是MSDN中的代码吗?我也按照那样做,但是不能实现啊!
      

  6.   

    谁发一个好点的源程序我,20分全给![email protected]
      

  7.   

    顺便也给我发一个
    [email protected]
    谢谢