이 포럼을 좋아합니다. VB.NET과 관련하여 초보자이며 약간의 문제가 발생했습니다.동적 UserControls에서 개체 호출 VB.NET
은 여기 내 코드
'decleare variables
Dim vmcount As Integer
Dim tabcount As Integer
Dim userControl As Control
Dim UserControlName As String
vmcount = combo_vmcount.SelectedItem
tabcount = 1
tab_con_vm.TabPages.Clear()
While (tabcount <= vmcount)
Dim tabname As New TabPage
'Load variables
userControl = New calc_usercontrol_vm
tabname.Text = "VM" & tabcount
tabname.Name = "VM" & tabcount
UserControlName = "UCVM" & tabcount
userControl.Name = UserControlName
'actions
tab_con_vm.TabPages.Add(tabname)
tabname.Controls.Add(userControl)
'next
tabcount = tabcount + 1
End While
End Sub
말썽 I는 동적으로 생성 된 UserControls의 개체를 호출 할 수있는 방법을 밖으로 작동 데 스 니펫입니다. 어쩌면 옵션을 생각해 보았지만 구문을 얻으려고 애쓴다. 사람이 어떤 아이디어 나 다른 방법이 있는지 ..
감사합니다 얘들 아 리처드
어떤 대상을 언급하고 있습니까? – Josh