-
You cannot use parentheses in the name entered in the menu editor.
Parentheses like this in the name indicate an array of controls, so you can directly enter the name? mcfile? , fill in the index office? 0? Just (as shown)
Besides, there is something wrong with the code you gave. Dim? mcont? As? Integer? In the process, it means that this variable is an ordinary variable. If you don't save it after this click event, the next time you execute this event, it will be zero, and the function of gradually adding menus will not be realized. Can you play it? Dim? mcont? As? Integer? Change to? Static electricity mcont? As? Integer, here? Static electricity Show? mcont? Is a static variable, its function is to keep the value of the variable at the last exit when it is executed again, namely:
Private? Sub? Command 1_Click()
Static electricity mcont? As? integer
mcont? =? mcont? +? 1
mcfile(0)。 Visible? =? real
Load? mcfile(mcont)
mcfile(mcont)。 Title? =? "File"? & amp? Str(mcont)
End? submarine