回复 2楼 风吹过b
谢谢!我明白了,可是还有一个问题
Private Sub TestType_Click()
Dim i&, n As Long
Dim MyChar
Dim FileName As String
TestTypeFlag = True
FileName = App.Path & "\123.txt"
Open FileName For Input As #1
i = 1
Do While Not EOF(1)
Input #1, MyChar
'
Load MenuSub(i)
MenuSub(i).Caption = MyChar
i = i + 1
Loop
Close #1
MenuCount = i - 1 //最后MenuCount=27
MenuSub(0).Visible = False
Me.PopupMenu MenuTestType
End Sub
以上是我读取文件123.txt,从里面加载数据,显示在子菜单项上,一共27项。
然后用完我卸载:
Private Sub Command2_Click()
Dim j As Long
ControlPanel.Show
For j = 1 To MenuCount
Unload 试验机.MenuSub(j)
Next j
Unload Me
End Sub
可是出错,提示如上图,好像最后一个菜单项无法卸载。