AW: Label als Objekt an Funktion übergeben
10.07.2007 21:20:15
Ramses
Hallo
hier mal ein Beispiel wie man den Font eines Labels umstgellt
Option Explicit
Private Sub CommandButton1_Click()
'Bei Tastendruck den Font umschalten
Format_Label UserForm1, Label1, Not Label1.Font.Italic
End Sub
'oder fix
Private Sub CommandButton1_Click()
'Kursiv
Format_Label UserForm1, Label1, True
End Sub
Private Sub CommandButton1_Click()
'Nicht Kursiv
Format_Label UserForm1, Label1, False
End Sub
und das z.B., als Function in ein Modul
Option Explicit
Function Format_Label(myUf As UserForm, myObj As Control, myAction As Boolean)
With myUf
With myObj
.Font.Italic = myAction
End With
End With
End Function
Du musst der Funktion sowohl die Userform und auch das Label als Object übergeben
Gruss Rainer