4
我想通過用戶控件複製我的窗體上的控件,該控件與添加了'new'的用戶控件具有相同的名稱。 (Label1的----> newLabel1)在Visual Basic 6.0中:創建動態控制數組
這是我的代碼片段:
Private Sub CreateLabel(ByRef lblControl As Control)
'lblControl - this is the control i would like to duplicate
'The reference to the new created control itself so i can work with it within this sub.
Dim newControl As Control
Set newControl = Form1.Controls.Add _
("Project.Project1", "new" & lblControl.Name, lblControl.Container)
newControl.Visible = True
End Sub
,如果我想複製其不被索引 怎麼過,我無法控制它的偉大工程複製一個數組中的控件作爲lblControl.Name只需取其名稱,而不是它的索引,並用索引名稱替換名稱(lblControl.Name &「(」lblControl.Index &「)」不起作用。
另外,創建一個控件並更改其索引值val你在創建後不工作。
所以我的問題是,我如何使用上述方法創建一個數組?