Public Enum TextAlign
vLeft
vcenter
vRight
End Enum
Public Enum StyleFont
vNormal
vBold
vItalic
vBoldItalic
End Enum
Public Enum Forecolor
vbBlack
vbBlue
vbGreen
vbRed
vbWhite
End Enum
Public Function Msg(ByVal Message As String, Optional ByVal Titre As String, _
Optional ByVal Align As TextAlign = vLeft, _
Optional ByVal FontStyle As StyleFont = vNormal, _
Optional ByVal ColorT As Forecolor = vbBlack)
With UserForm1
'Label1
.Label1.BackColor = &HFFFFFF
.Label1.TextAlign = IIf(Align < 0, 1, IIf(Align > 2, 1, Align + 1))
.Label1.Font.Bold = FontStyle Mod 2 <> 0
.Label1.Font.Italic = FontStyle > 1
.Label1.Forecolor = ColorT
.Label1.Caption = Message
'UserForm
.BackColor = &HFFFFFF 'Blanc
.Caption = Titre
.Show
End With
End Function