Visual Basic 6. Руководство разработчика


         

Скелет элемента управления ActiveX - часть 4


m_Effect = New_Effect

PropertyChanged "Effect"

End Property

Public Property Get TextAlignment() As Integer

TextAlignment = m_TextAlignment

End Property

Public Property Let TextAlignment(ByVal New_TextAlignment As Integer)

m_TextAlignment = New_TextAlignment

PropertyChanged "TextAlignment"

End Property

' Инициализация свойств

Private Sub UserControl_InitProperties()

Set Font = Ambient.Font

m­_Caption = m_def_Caption

m_Effect = m_def_Effect

m_TextAlignment = m_def_TextAlignment

UserControl.BorderStyle = 1

UserControl.BackStyle = 1

End Sub

' Загрузка значений свойств

Private Sub UserControl_ReadProperties(PropBag As PropertyBag)

Set Font = PropBag.ReadProperty("Font",Ambient.Font)

UserControl.BorderStyle = PropBag.ReadProperty ("BorderStyle", 0)

UserControl.BackStyle = PropBag.ReadProperty ("BackStyle", 1)

UserControl.Enabled = PropBag.ReadProperty ("Enabled", True)

UserControl.ForeColor = PropBag.ReadProperty ("ForeColor", _

   &H80000012)

UserControl.MousePointer = PropBag.ReadProperty ("MousePointer", 0)

UserControl.OLEDropMode = PropBag.ReadProperty ("OLEDropMode", 0)

Set Picture = PropBag.ReadProperty ("Picture", Nothing)

m_Caption = PropBag.ReadProperty ("Caption", m_def_Caption)

m_Effect = PropBag.ReadProperty ("Effect", m_def_Effect)

m_TextAlignment = PropBag.ReadProperty ("TextAlignment", _

  m_def_TextAlignment)

UserControl.BackColor = PropBag.ReadProperty ("BackColor", _

  SH8000000F)

End Sub

' Сохранение значений свойств

Private Sub UserControl_WriteProperties(PropBag As PropertyBag)

Call PropBag.WriteProperty("Font", Font, Ambient.Font)

Call PropBag. WriteProperty("BorderStyle",

UserControl.BorderStyle,0)

Call PropBag.WriteProperty("BackStyle", UserControl.BackStyle, 1)

Call PropBag.WriteProperty("Enabled", UserControl.Enabled, True) Call PropBag.WriteProperty ("ForeColor", UserControl.ForeColor, _




Содержание  Назад  Вперед