7,763
社区成员
发帖
与我相关
我的任务
分享
dim conts as control
for each conts in me.controls
if lcase(typename(conts))="menu" then
select case conts.name
case "mnuName1"
conts.Enabled=True '设可用
case "mnuName2"
conts.Enabled=False '设不可用
...........
end select
end if
next
Private Sub Form_Load()
Dim a As Object
For Each a In Me.Controls
If TypeOf a Is Menu Then
Debug.Print a.Caption
Debug.Print a.Name
End If
Next
End Sub