سلام
قبلا در یک تاپیک روشی را با سورس با استفاده از یک Activex قرار دادم لطفا با جستجو پیدا کنید ولی سورس ActiveX به قرار ذیل است :
(نام فایل هم LabelExtended بود)
Public Sub Font(FontName As String, FontSize As Single, FontBold As Boolean)
With UserControl.Label1.Font
.Name = FontName
.Size = FontSize
.Bold = FontBold
End With
End Sub
Public Sub Alignment(Value As AlignmentConstants)
UserControl.Label1.Alignment = Value
End Sub
Public Property Get Caption() As String
Caption = UserControl.Label1.Caption
End Property
Public Property Let Caption(Value As String)
UserControl.Label1.Caption = Value
PropertyChanged "Caption"
End Property
Public Property Get ForeColor() As OLE_COLOR
ForeColor = UserControl.Label1.ForeColor
End Property
Public Property Let ForeColor(Value As OLE_COLOR)
UserControl.Label1.ForeColor = Value
PropertyChanged "ForeColor"
End Property
Public Property Get BackColor() As OLE_COLOR
BackColor = UserControl.Label1.BackColor
End Property
Public Property Let BackColor(Value As OLE_COLOR)
UserControl.Label1.BackColor = Value
PropertyChanged "BackColor"
End Property
Private Sub UserControl_Resize()
With UserControl.Label1
.Top = 0
.Left = 0
.Width = UserControl.ScaleWidth
.Height = UserControl.ScaleHeight
End With
End Sub
Private Sub UserControl_InitProperties()
If Not UserControl.Ambient.UserMode Then
Me.Caption = UserControl.Name
Me.ForeColor = 0
Me.BackColor = RGB(255, 255, 255)
End If
Call UserControl_Resize
End Sub
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
Me.Caption = PropBag.ReadProperty("Caption", "")
Me.ForeColor = PropBag.ReadProperty("ForeColor", UserControl.ForeColor)
Me.BackColor = PropBag.ReadProperty("BackColor", UserControl.BackColor)
End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("Caption", Me.Caption, "")
Call PropBag.WriteProperty("ForeColor", Me.ForeColor, UserControl.ForeColor)
Call PropBag.WriteProperty("BackColor", Me.BackColor, UserControl.BackColor)
End Sub