代码
Option Explicit
Enum Atype
ltype = 1
rtype = 2
End Enum
'属性变量:
Dim m_ArrowType As Atype
'注意!不要删除或修改下列被注释的行!
'MemberInfo=14,0,0,0
Public Property Get ArrowType() As Atype
ArrowType = m_ArrowType
End PropertyPublic Property Let ArrowType(ByVal New_ArrowType As Atype)
m_ArrowType = New_ArrowType
Select Case New_ArrowType
Case ltype
l.Visible = True
l.Left = 0
l.Top = 0
r.Visible = False
u.Visible = False
d.Visible = False
Case rtype
r.Visible = True
r.Left = 0
r.Top = 0
l.Visible = False
u.Visible = False
d.Visible = False
End Select
PropertyChanged "ArrowType"
Call UserControl_Resize
End PropertyPrivate Sub UserControl_InitProperties()
m_ArrowType = rtype
End Sub'从存贮器中加载属性值
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
m_ArrowType = PropBag.ReadProperty("ArrowType", m_ArrowType)
End SubPrivate Sub UserControl_Resize()
Select Case m_ArrowType
Case ltype
l.Width = UserControl.Width
UserControl.Height = l.Height
l.Visible = True
l.Left = 0
l.Top = 0
r.Visible = False
u.Visible = False
d.Visible = False
Case rtype
r.Width = UserControl.Width
UserControl.Height = r.Height
r.Visible = True
r.Left = 0
r.Top = 0
l.Visible = False
u.Visible = False
d.Visible = False End Select
End Sub'将属性值写到存储器
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("ArrowType", m_ArrowType, rtype)
End Sub
Option Explicit
Enum Atype
ltype = 1
rtype = 2
End Enum
'属性变量:
Dim m_ArrowType As Atype
'注意!不要删除或修改下列被注释的行!
'MemberInfo=14,0,0,0
Public Property Get ArrowType() As Atype
ArrowType = m_ArrowType
End PropertyPublic Property Let ArrowType(ByVal New_ArrowType As Atype)
m_ArrowType = New_ArrowType
Select Case New_ArrowType
Case ltype
l.Visible = True
l.Left = 0
l.Top = 0
r.Visible = False
u.Visible = False
d.Visible = False
Case rtype
r.Visible = True
r.Left = 0
r.Top = 0
l.Visible = False
u.Visible = False
d.Visible = False
End Select
PropertyChanged "ArrowType"
Call UserControl_Resize
End PropertyPrivate Sub UserControl_InitProperties()
m_ArrowType = rtype
End Sub'从存贮器中加载属性值
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
m_ArrowType = PropBag.ReadProperty("ArrowType", m_ArrowType)
End SubPrivate Sub UserControl_Resize()
Select Case m_ArrowType
Case ltype
l.Width = UserControl.Width
UserControl.Height = l.Height
l.Visible = True
l.Left = 0
l.Top = 0
r.Visible = False
u.Visible = False
d.Visible = False
Case rtype
r.Width = UserControl.Width
UserControl.Height = r.Height
r.Visible = True
r.Left = 0
r.Top = 0
l.Visible = False
u.Visible = False
d.Visible = False End Select
End Sub'将属性值写到存储器
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("ArrowType", m_ArrowType, rtype)
End Sub
m_ArrowType = New_ArrowType 是不是这里出了问题,你的问题是啥啊?