如图,我想做一个自定义控件,想加一些类似picturebox的Appearance属性和BackColor属性,并将它们传递给控件内部的picturebox。但是我用如下代码可以实现值的传递:Public Property Get Appearance() As Integer
Appearance = Picture1.Appearance
End PropertyPublic Property Let Appearance(ByVal a1 As Integer)
Picture1.Appearance = a1
End PropertyPublic Property Get BackColor() As Long
BackColor = Picture1.BackColor
End PropertyPublic Property Let BackColor(ByVal c1 As Long)
Picture1.BackColor = c1
End Property但添加到工程中的是效果如下:
请问高手,如何把自定义属性做得跟普通控件属性效果一样呢?
Appearance = Picture1.Appearance
End PropertyPublic Property Let Appearance(ByVal a1 As Integer)
Picture1.Appearance = a1
End PropertyPublic Property Get BackColor() As Long
BackColor = Picture1.BackColor
End PropertyPublic Property Let BackColor(ByVal c1 As Long)
Picture1.BackColor = c1
End Property但添加到工程中的是效果如下:
请问高手,如何把自定义属性做得跟普通控件属性效果一样呢?
Flat = 0
[3D] = 1
End EnumPublic Property Get Appearance() As ControlAppearance
Appearance = Picture1.Appearance
End PropertyPublic Property Let Appearance(ByVal a1 As ControlAppearance)
Picture1.Appearance = a1
End PropertyPublic Property Get BackColor() As OLE_COLOR
BackColor = Picture1.BackColor
End PropertyPublic Property Let BackColor(ByVal c1 As OLE_COLOR)
Picture1.BackColor = c1
End Property
Set Picture = Picture1.Picture
End PropertyPublic Property Set Picture(ByVal pp As Picture)
Set Picture1.Picture = pp
End Property可传递picture属性。谢谢各位的回答。
Set Picture = Picture1.Picture
End PropertyPublic Property Set Picture(ByVal RHS As IPictureDisp)
Set Picture1.Picture = RHS
End Property