有一个lable1 ,有几个菜单a,b,c,
点击菜单a要求lable1.Caption =a.Caption我用过程setform1来完成并规定位置
现要求点击lable1能call a_Click() 不是在lable1_Click()内写因为lable可能被
其它菜单调用。其他菜单点击后lable1基变成菜单.Caption,点击lable1要能回调Call setform1(Form1, a,  500, 100, True)Public Sub setform1(f As Object, b As Menu, top As Integer, left As Integer, v As Boolean)
f.Label1.Caption = b.Caption
f.Label1.top = top
f.Label1.left = left
f.Label1.Visible = v
End If

解决方案 »

  1.   

    是不是这个意思?Sub setform(b As Menu, top As Integer, left As Integer, v As Boolean)
    Label1.Caption = b.Caption
    Label1.top = top
    Label1.left = left
    Label1.Visible = v
    MsgBox "you click menu " & b.Name
    End SubPrivate Sub a_Click()
    setform a, 500, 100, True
    End SubPrivate Sub b_Click()
    setform b, 500, 100, True
    End SubPrivate Sub c_Click()
    setform c, 500, 100, True
    End SubPrivate Sub Label1_Click()
    a_Click
    End Sub