我用VB新建了一个控件工程,并添加了一个窗体Form1.
当控件运行的时候,可以在控件主界面里使用form1.show来显示该窗体。但是我怎么能在窗体Form1中访问控件主界面上的label控件,将其.Caption赋值为"我的控件"?
这能实现吗?
当控件运行的时候,可以在控件主界面里使用form1.show来显示该窗体。但是我怎么能在窗体Form1中访问控件主界面上的label控件,将其.Caption赋值为"我的控件"?
这能实现吗?
调试欢乐多
usercontrol里:
---------------------------------------------------
Friend Property Get Label() As Label
Set Label = Label1
End PropertyPrivate Sub Command1_Click()
Set Form1.uc = Me
Form1.Show 1
Set Form1.uc = Nothing
End Sub
---------------------------------------------------
form里:
Public uc As UserControl1Private Sub Command1_Click()
uc.Label = "我的控件"
End Sub