Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Gambas 中,我可以像这样创建控件:
btn = New Button(parent) As "MyButton"
现在事件监听:
MyButton_Click()
但是如何创建具有动态名称的元素,例如:
dim tmp as string tmp = "MyButton" btn = New Button(parent) As tmp
最后一行不起作用,但这就是如何处理这个问题的问题。
我必须使用以下方法将对象附加到其父窗体:
dim tmp as string tmp = "MyButton" btn = New Button(parent) Object.Attach(btn, ParentForm, tmp)