vb6 用户控件 Picture 出错 求帮助呀。。
Private Sub TTAMKJ1_Click() 'ttakj1 是用户控件的名称TTAMKJ.Picture = Picture1.Picture
TTAMKJ.MaskPicture = Picture1.Picture
End Sub
用户控件代码:
Public Property Get Picture() As Picture
Set Picture = UserControl.Picture
End Property
Public Property Set Picture(ByVal New_Picture As Picture)
Set UserControl.Picture = New_Picture
PropertyChanged "Picture"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=UserControl,UserControl,-1,Image
Public Property Get Image() As Picture
Set Image = UserControl.Image
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=8,0,0,
Public Property Get MaskColor() As Long
MaskColor = UserControl.MaskColor
End Property
Public Property Let MaskColor(ByVal New_MaskColor As Long)
UserControl.MaskColor = New_MaskColor
PropertyChanged "MaskColor"
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=11,0,0,
Public Property Get MaskPicture() As Picture
Set MaskPicture = UserControl.MaskPicture
End Property
Public Property Set MaskPicture(ByVal New_MaskPicture As Picture)
Set UserControl.MaskPicture = New_MaskPicture
PropertyChanged "MaskPicture"
End Property
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
UserControl.BackColor = PropBag.ReadProperty("BackColor", &H0&)
UserControl.BackStyle = PropBag.ReadProperty("BackStyle", 0)
UserControl.BorderStyle = PropBag.ReadProperty("BorderStyle", 0)
UserControl.ForeColor = PropBag.ReadProperty("ForeColor", &H80000012)
UserControl.Enabled = PropBag.ReadProperty("Enabled", True)
UserControl.FillStyle = PropBag.ReadProperty("FillStyle", 1)
UserControl.FillColor = PropBag.ReadProperty("FillColor", &H0&)
Set UserControl.Picture = PropBag.ReadProperty("Picture", Nothing)
UserControl.MaskColor = PropBag.ReadProperty("MaskColor", 0)
Set UserControl.MaskPicture = PropBag.ReadProperty("MaskPicture", Nothing)
Set UserControl.Font = PropBag.ReadProperty("Font", Ambient.Font)
m_Caption = PropBag.ReadProperty("Caption", m_def_Caption)
End Sub
'将属性值写到存储器
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("BackColor", UserControl.BackColor, &H0&)
Call PropBag.WriteProperty("BackStyle", UserControl.BackStyle, 0)
Call PropBag.WriteProperty("BorderStyle", UserControl.BorderStyle, 0)
Call PropBag.WriteProperty("MaskPicture", MaskPicture, 0)
Call PropBag.WriteProperty("Picture", Picture, 0)
Call PropBag.WriteProperty("ForeColor", UserControl.ForeColor, &H80000012)
Call PropBag.WriteProperty("Enabled", UserControl.Enabled, True)
Call PropBag.WriteProperty("FillStyle", UserControl.FillStyle, 1)
Call PropBag.WriteProperty("FillColor", UserControl.FillColor, &H0&)
Call PropBag.WriteProperty("Picture", Picture, Nothing)
Call PropBag.WriteProperty("MaskColor", UserControl.MaskPicture, m_def_MaskColor)
Call PropBag.WriteProperty("MaskPicture", UserControl.MaskPicture, Nothing)
Call PropBag.WriteProperty("Font", UserControl.Font, Ambient.Font)
Call PropBag.WriteProperty("Caption", m_Caption, m_def_Caption)
End Sub
不知道哪里出错 求指点!!