用户控件问题 答对的追加分!!!最高加到50分
来源:百度知道 编辑:UC知道 时间:2024/05/30 17:32:31
请看我的代码
Option Explicit
'这个用户控件上有名为t1,t2的image,以及两个label:label1,label2
Event Click()
Public Property Get MyPicture() As Picture
Set MyPicture = T1.Picture
Set MyPicture = T2.Picture
End Property
Public Property Set MyPicture(ByVal New_HoverPicture As Picture)
Set T1.Picture = New_HoverPicture
Set T2.Picture = New_HoverPicture
RedrawControl
PropertyChanged "myPicture"
End Property
Public Property Get La_bel() As String
La_bel = Label2
End Property
Public Property Let La_bel(ByVal New_La_bel As String)
Label2 = New_La_bel
PropertyChanged "la_bel" '这几句是什么意思...还不是很清楚!
End Property
Private Function RedrawControl()
T1.Picture = MyPicture
T2.Picture = MyPicture
T2.Visible = False
T1.Visible = True
End Function
Private
Option Explicit
'这个用户控件上有名为t1,t2的image,以及两个label:label1,label2
Event Click()
Public Property Get MyPicture() As Picture
Set MyPicture = T1.Picture
Set MyPicture = T2.Picture
End Property
Public Property Set MyPicture(ByVal New_HoverPicture As Picture)
Set T1.Picture = New_HoverPicture
Set T2.Picture = New_HoverPicture
RedrawControl
PropertyChanged "myPicture"
End Property
Public Property Get La_bel() As String
La_bel = Label2
End Property
Public Property Let La_bel(ByVal New_La_bel As String)
Label2 = New_La_bel
PropertyChanged "la_bel" '这几句是什么意思...还不是很清楚!
End Property
Private Function RedrawControl()
T1.Picture = MyPicture
T2.Picture = MyPicture
T2.Visible = False
T1.Visible = True
End Function
Private
Public Property Get MyPicture() As Picture
Set MyPicture = T1.Picture
Set MyPicture = T2.Picture
End Property
Public Property Set MyPicture(ByVal New_HoverPicture As Picture)
Set T1.Picture = New_HoverPicture
Set T2.Picture = New_HoverPicture
RedrawControl
PropertyChanged "myPicture"
End Property
Public Property Get La_bel() As String
La_bel = Label2
End Property
Public Property Let La_bel(ByVal New_La_bel As String)
Label2 = New_La_bel
PropertyChanged "la_bel" '这几句是什么意思...还不是很清楚!
End Property
这些是类的继承,本程序没有用到