Hi Dieter,
wäre echt klasse wenn Du da einen globalen Weg finden würdest.
Bin selber natürlich auch dabei einen Weg zu finden, wobei alle
Formen des gesamten Projektes als Beispiel:
Form1
frmOptionen
frmAuslesen
frmAdresse
frmMuster
etc.
ca. 30 Formen mit unterschiedlichen Namen
Jetzt sollen aber alle diese Formen auch die gleichen Farb und Eigenschaftswerte
bekommen wie sie in den letzten Codes geschrieben war.
Also ListBox, TextBox, CommandButton etc.
Nur eben für alle Formen mit den entsprechenden Form1.Controls global
für alle weiteren Formen im Projekt.
Hier der Beispielcode, der auch funktioniert nur eben sehr umfangreich
und wenn eine neue Form hinzukommen soll ist wieder viel zu schreiben.
Aber bitte nicht hauen weil ich zu viel reinschreibe *ggg*.
'
'
Private Sub Form_Load()
Einlesen ' <------ Einlesen!
End Sub
Private Sub Form_Unload(Cancel As Integer)
Speichern ' <------ Speichern!
Unload Me
End
End Sub
Private Sub Einlesen() ' <------ Einlesen!
FormHintergrundFarbeIn
FensterSizeIn
FrameHintergrundFarbeIn
FrameVordergrundFarbeIn
ButtonHintergrundFarbeIn
ListeVordergrundFarbeIn
ListeHintergrundFarbeIn
End Sub
Private Sub Speichern() ' <------ Speichern!
FormHintergrundFarbeOut
FensterSizeOut
FrameHintergrundFarbeOut
FrameVordergrundFarbeOut
ButtonHintergrundFarbeOut
ListeVordergrundFarbeOut
ListeHintergrundFarbeOut
End Sub
' ################################################ Form! #################
Private Sub FormHintergrundFarbeIn()
frmFarbOptionen.BackColor = GetSetting("COLOR", "Optionen", "frmFarbOptionen.BackColor", Default)
Form1.BackColor = GetSetting("COLOR", "Optionen", "Form1.BackColor", Default)
Form2.BackColor = GetSetting("COLOR", "Optionen", "Form2.BackColor", Default)
Form3.BackColor = GetSetting("COLOR", "Optionen", "Form3.BackColor", Default)
Form4.BackColor = GetSetting("COLOR", "Optionen", "Form4.BackColor", Default)
Form5.BackColor = GetSetting("COLOR", "Optionen", "Form5.BackColor", Default)
Form6.BackColor = GetSetting("COLOR", "Optionen", "Form6.BackColor", Default)
End Sub
Private Sub FormHintergrundFarbeOut()
SaveSetting "COLOR", "Optionen", "frmFarbOptionen.BackColor", frmFarbOptionen.BackColor
SaveSetting "COLOR", "Optionen", "Form1.BackColor", Form1.BackColor
SaveSetting "COLOR", "Optionen", "Form2.BackColor", Form2.BackColor
SaveSetting "COLOR", "Optionen", "Form3.BackColor", Form3.BackColor
SaveSetting "COLOR", "Optionen", "Form4.BackColor", Form4.BackColor
SaveSetting "COLOR", "Optionen", "Form5.BackColor", Form5.BackColor
SaveSetting "COLOR", "Optionen", "Form6.BackColor", Form6.BackColor
End Sub
Private Sub cmdHintergrundForm_Click()
On Local Error Resume Next
With CommonDialog1
.CancelError = True
.ShowColor
If Err = 0 Then
frmFarbOptionen.BackColor = CommonDialog1.Color
Form1.BackColor = CommonDialog1.Color
Form2.BackColor = CommonDialog1.Color
Form3.BackColor = CommonDialog1.Color
Form4.BackColor = CommonDialog1.Color
Form5.BackColor = CommonDialog1.Color
Form6.BackColor = CommonDialog1.Color
End If
End With
End Sub
' ################################################ Frame! #################
Private Sub FrameHintergrundFarbeIn()
Dim f As Control
For Each f In frmFarbOptionen.Controls
If TypeOf f Is Frame Then
f.BackColor = GetSetting("COLOR", "Optionen", "f.BackColor", Default)
End If
Next f
For Each f In Form1.Controls
If TypeOf f Is Frame Then
f.BackColor = GetSetting("COLOR", "Optionen", "f.BackColor", Default)
End If
Next f
For Each f In Form2.Controls
If TypeOf f Is Frame Then
f.BackColor = GetSetting("COLOR", "Optionen", "f.BackColor", Default)
End If
Next f
For Each f In Form3.Controls
If TypeOf f Is Frame Then
f.BackColor = GetSetting("COLOR", "Optionen", "f.BackColor", Default)
End If
Next f
For Each f In Form4.Controls
If TypeOf f Is Frame Then
f.BackColor = GetSetting("COLOR", "Optionen", "f.BackColor", Default)
End If
Next f
For Each f In Form5.Controls
If TypeOf f Is Frame Then
f.BackColor = GetSetting("COLOR", "Optionen", "f.BackColor", Default)
End If
Next f
For Each f In Form6.Controls
If TypeOf f Is Frame Then
f.BackColor = GetSetting("COLOR", "Optionen", "f.BackColor", Default)
End If
Next f
End Sub
Private Sub FrameHintergrundFarbeOut()
Dim f As Control
For Each f In frmFarbOptionen.Controls
If TypeOf f Is Frame Then
SaveSetting "COLOR", "Optionen", "f.BackColor", f.BackColor
End If
Next f
For Each f In Form1.Controls
If TypeOf f Is Frame Then
SaveSetting "COLOR", "Optionen", "f.BackColor", f.BackColor
End If
Next f
For Each f In Form2.Controls
If TypeOf f Is Frame Then
SaveSetting "COLOR", "Optionen", "f.BackColor", f.BackColor
End If
Next f
For Each f In Form3.Controls
If TypeOf f Is Frame Then
SaveSetting "COLOR", "Optionen", "f.BackColor", f.BackColor
End If
Next f
For Each f In Form4.Controls
If TypeOf f Is Frame Then
SaveSetting "COLOR", "Optionen", "f.BackColor", f.BackColor
End If
Next f
For Each f In Form5.Controls
If TypeOf f Is Frame Then
SaveSetting "COLOR", "Optionen", "f.BackColor", f.BackColor
End If
Next f
For Each f In Form6.Controls
If TypeOf f Is Frame Then
SaveSetting "COLOR", "Optionen", "f.BackColor", f.BackColor
End If
Next f
End Sub
Private Sub cmdFrameHintergrund_Click() 'cmd
On Local Error Resume Next
With CommonDialog1
.CancelError = True
.ShowColor
If Err = 0 Then
Dim f As Control
For Each f In frmFarbOptionen.Controls
If TypeOf f Is Frame Then
f.BackColor = CommonDialog1.Color
End If
Next f
For Each f In Form1.Controls
If TypeOf f Is Frame Then
f.BackColor = CommonDialog1.Color
End If
Next f
For Each f In Form2.Controls
If TypeOf f Is Frame Then
f.BackColor = CommonDialog1.Color
End If
Next f
For Each f In Form3.Controls
If TypeOf f Is Frame Then
f.BackColor = CommonDialog1.Color
End If
Next f
For Each f In Form4.Controls
If TypeOf f Is Frame Then
f.BackColor = CommonDialog1.Color
End If
Next f
For Each f In Form5.Controls
If TypeOf f Is Frame Then
f.BackColor = CommonDialog1.Color
End If
Next f
For Each f In Form6.Controls
If TypeOf f Is Frame Then
f.BackColor = CommonDialog1.Color
End If
Next f
End If
End With
End Sub
Private Sub FrameVordergrundFarbeIn()
Dim f As Control
For Each f In frmFarbOptionen.Controls
If TypeOf f Is Frame Then
f.ForeColor = GetSetting("COLOR", "Optionen", "f.ForeColor", Default)
End If
Next f
For Each f In Form1.Controls
If TypeOf f Is Frame Then
f.ForeColor = GetSetting("COLOR", "Optionen", "f.ForeColor", Default)
End If
Next f
For Each f In Form2.Controls
If TypeOf f Is Frame Then
f.ForeColor = GetSetting("COLOR", "Optionen", "f.ForeColor", Default)
End If
Next f
For Each f In Form3.Controls
If TypeOf f Is Frame Then
f.ForeColor = GetSetting("COLOR", "Optionen", "f.ForeColor", Default)
End If
Next f
For Each f In Form4.Controls
If TypeOf f Is Frame Then
f.ForeColor = GetSetting("COLOR", "Optionen", "f.ForeColor", Default)
End If
Next f
For Each f In Form5.Controls
If TypeOf f Is Frame Then
f.ForeColor = GetSetting("COLOR", "Optionen", "f.ForeColor", Default)
End If
Next f
For Each f In Form6.Controls
If TypeOf f Is Frame Then
f.ForeColor = GetSetting("COLOR", "Optionen", "f.ForeColor", Default)
End If
Next f
End Sub
Private Sub FrameVordergrundFarbeOut()
Dim f As Control
For Each f In frmFarbOptionen.Controls
If TypeOf f Is Frame Then
SaveSetting "COLOR", "Optionen", "f.ForeColor", f.ForeColor
End If
Next f
For Each f In Form1.Controls
If TypeOf f Is Frame Then
SaveSetting "COLOR", "Optionen", "f.ForeColor", f.ForeColor
End If
Next f
For Each f In Form2.Controls
If TypeOf f Is Frame Then
SaveSetting "COLOR", "Optionen", "f.ForeColor", f.ForeColor
End If
Next f
For Each f In Form3.Controls
If TypeOf f Is Frame Then
SaveSetting "COLOR", "Optionen", "f.ForeColor", f.ForeColor
End If
Next f
For Each f In Form4.Controls
If TypeOf f Is Frame Then
SaveSetting "COLOR", "Optionen", "f.ForeColor", f.ForeColor
End If
Next f
For Each f In Form5.Controls
If TypeOf f Is Frame Then
SaveSetting "COLOR", "Optionen", "f.ForeColor", f.ForeColor
End If
Next f
For Each f In Form6.Controls
If TypeOf f Is Frame Then
SaveSetting "COLOR", "Optionen", "f.ForeColor", f.ForeColor
End If
Next f
End Sub
Private Sub cmdFrameVordergrund_Click() 'cmd
On Local Error Resume Next
With CommonDialog1
.CancelError = True
.ShowColor
If Err = 0 Then
Dim f As Control
For Each f In frmFarbOptionen.Controls
If TypeOf f Is Frame Then
f.ForeColor = CommonDialog1.Color
End If
Next f
For Each f In Form1.Controls
If TypeOf f Is Frame Then
f.ForeColor = CommonDialog1.Color
End If
Next f
For Each f In Form2.Controls
If TypeOf f Is Frame Then
f.ForeColor = CommonDialog1.Color
End If
Next f
For Each f In Form3.Controls
If TypeOf f Is Frame Then
f.ForeColor = CommonDialog1.Color
End If
Next f
For Each f In Form4.Controls
If TypeOf f Is Frame Then
f.ForeColor = CommonDialog1.Color
End If
Next f
For Each f In Form5.Controls
If TypeOf f Is Frame Then
f.ForeColor = CommonDialog1.Color
End If
Next f
For Each f In Form6.Controls
If TypeOf f Is Frame Then
f.ForeColor = CommonDialog1.Color
End If
Next f
End If
End With
End Sub
' ################################################ Button! #################
Private Sub ButtonHintergrundFarbeIn()
Dim b As Control
For Each b In frmFarbOptionen.Controls
If TypeOf b Is CommandButton Then
b.BackColor = GetSetting("COLOR", "Optionen", "b.BackColor", Default)
End If
Next b
For Each b In Form1.Controls
If TypeOf b Is CommandButton Then
b.BackColor = GetSetting("COLOR", "Optionen", "b.BackColor", Default)
End If
Next b
For Each b In Form2.Controls
If TypeOf b Is CommandButton Then
b.BackColor = GetSetting("COLOR", "Optionen", "b.BackColor", Default)
End If
Next b
For Each b In Form3.Controls
If TypeOf b Is CommandButton Then
b.BackColor = GetSetting("COLOR", "Optionen", "b.BackColor", Default)
End If
Next b
For Each b In Form4.Controls
If TypeOf b Is CommandButton Then
b.BackColor = GetSetting("COLOR", "Optionen", "b.BackColor", Default)
End If
Next b
For Each b In Form5.Controls
If TypeOf b Is CommandButton Then
b.BackColor = GetSetting("COLOR", "Optionen", "b.BackColor", Default)
End If
Next b
For Each b In Form6.Controls
If TypeOf b Is CommandButton Then
b.BackColor = GetSetting("COLOR", "Optionen", "b.BackColor", Default)
End If
Next b
End Sub
Private Sub ButtonHintergrundFarbeOut()
Dim b As Control
For Each b In frmFarbOptionen.Controls
If TypeOf b Is CommandButton Then
SaveSetting "COLOR", "Optionen", "b.BackColor", b.BackColor
End If
Next b
For Each b In Form1.Controls
If TypeOf b Is CommandButton Then
SaveSetting "COLOR", "Optionen", "b.BackColor", b.BackColor
End If
Next b
For Each b In Form2.Controls
If TypeOf b Is CommandButton Then
SaveSetting "COLOR", "Optionen", "b.BackColor", b.BackColor
End If
Next b
For Each b In Form3.Controls
If TypeOf b Is CommandButton Then
SaveSetting "COLOR", "Optionen", "b.BackColor", b.BackColor
End If
Next b
For Each b In Form4.Controls
If TypeOf b Is CommandButton Then
SaveSetting "COLOR", "Optionen", "b.BackColor", b.BackColor
End If
Next b
For Each b In Form5.Controls
If TypeOf b Is CommandButton Then
SaveSetting "COLOR", "Optionen", "b.BackColor", b.BackColor
End If
Next b
For Each b In Form6.Controls
If TypeOf b Is CommandButton Then
SaveSetting "COLOR", "Optionen", "b.BackColor", b.BackColor
End If
Next b
End Sub
Private Sub cmdButtonHintergrund_Click() 'cmd
On Local Error Resume Next
With CommonDialog1
.CancelError = True
.ShowColor
If Err = 0 Then
Dim b As Control
For Each b In frmFarbOptionen.Controls
If TypeOf b Is CommandButton Then
b.BackColor = CommonDialog1.Color
End If
Next b
For Each b In Form1.Controls
If TypeOf b Is CommandButton Then
b.BackColor = CommonDialog1.Color
End If
Next b
For Each b In Form2.Controls
If TypeOf b Is CommandButton Then
b.BackColor = CommonDialog1.Color
End If
Next b
For Each b In Form3.Controls
If TypeOf b Is CommandButton Then
b.BackColor = CommonDialog1.Color
End If
Next b
For Each b In Form4.Controls
If TypeOf b Is CommandButton Then
b.BackColor = CommonDialog1.Color
End If
Next b
For Each b In Form5.Controls
If TypeOf b Is CommandButton Then
b.BackColor = CommonDialog1.Color
End If
Next b
For Each b In Form6.Controls
If TypeOf b Is CommandButton Then
b.BackColor = CommonDialog1.Color
End If
Next b
End If
End With
End Sub
' ################################################ Liste! #################
Private Sub ListeHintergrundFarbeIn()
Dim L As Control
For Each L In frmFarbOptionen.Controls
If TypeOf L Is ListBox Then
L.BackColor = GetSetting("COLOR", "Optionen", "L.BackColor", Default)
End If
Next L
For Each L In Form1.Controls
If TypeOf L Is ListBox Then
L.BackColor = GetSetting("COLOR", "Optionen", "L.BackColor", Default)
End If
Next L
For Each L In Form2.Controls
If TypeOf L Is ListBox Then
L.BackColor = GetSetting("COLOR", "Optionen", "L.BackColor", Default)
End If
Next L
For Each L In Form3.Controls
If TypeOf L Is ListBox Then
L.BackColor = GetSetting("COLOR", "Optionen", "L.BackColor", Default)
End If
Next L
For Each L In Form4.Controls
If TypeOf L Is ListBox Then
L.BackColor = GetSetting("COLOR", "Optionen", "L.BackColor", Default)
End If
Next L
For Each L In Form5.Controls
If TypeOf L Is ListBox Then
L.BackColor = GetSetting("COLOR", "Optionen", "L.BackColor", Default)
End If
Next L
For Each L In Form6.Controls
If TypeOf L Is ListBox Then
L.BackColor = GetSetting("COLOR", "Optionen", "L.BackColor", Default)
End If
Next L
End Sub
Private Sub ListeHintergrundFarbeOut()
Dim L As Control
For Each L In frmFarbOptionen.Controls
If TypeOf L Is ListBox Then
SaveSetting "COLOR", "Optionen", "L.BackColor", L.BackColor
End If
Next L
For Each L In Form1.Controls
If TypeOf L Is ListBox Then
SaveSetting "COLOR", "Optionen", "L.BackColor", L.BackColor
End If
Next L
For Each L In Form2.Controls
If TypeOf L Is ListBox Then
SaveSetting "COLOR", "Optionen", "L.BackColor", L.BackColor
End If
Next L
For Each L In Form3.Controls
If TypeOf L Is ListBox Then
SaveSetting "COLOR", "Optionen", "L.BackColor", L.BackColor
End If
Next L
For Each L In Form4.Controls
If TypeOf L Is ListBox Then
SaveSetting "COLOR", "Optionen", "L.BackColor", L.BackColor
End If
Next L
For Each L In Form5.Controls
If TypeOf L Is ListBox Then
SaveSetting "COLOR", "Optionen", "L.BackColor", L.BackColor
End If
Next L
For Each L In Form6.Controls
If TypeOf L Is ListBox Then
SaveSetting "COLOR", "Optionen", "L.BackColor", L.BackColor
End If
Next L
End Sub
Private Sub cmdListeHintergrund_Click() 'cmd
On Local Error Resume Next
With CommonDialog1
.CancelError = True
.ShowColor
If Err = 0 Then
Dim L As Control
For Each L In frmFarbOptionen.Controls
If TypeOf L Is ListBox Then
L.BackColor = CommonDialog1.Color
End If
Next L
For Each L In Form1.Controls
If TypeOf L Is ListBox Then
L.BackColor = CommonDialog1.Color
End If
Next L
For Each L In Form2.Controls
If TypeOf L Is ListBox Then
L.BackColor = CommonDialog1.Color
End If
Next L
For Each L In Form3.Controls
If TypeOf L Is ListBox Then
L.BackColor = CommonDialog1.Color
End If
Next L
For Each L In Form4.Controls
If TypeOf L Is ListBox Then
L.BackColor = CommonDialog1.Color
End If
Next L
For Each L In Form5.Controls
If TypeOf L Is ListBox Then
L.BackColor = CommonDialog1.Color
End If
Next L
For Each L In Form6.Controls
If TypeOf L Is ListBox Then
L.BackColor = CommonDialog1.Color
End If
Next L
End If
End With
End Sub
Private Sub ListeVordergrundFarbeIn()
Dim L As Control
For Each L In frmFarbOptionen.Controls
If TypeOf L Is ListBox Then
L.ForeColor = GetSetting("COLOR", "Optionen", "L.ForeColor", Default)
End If
Next L
For Each L In Form1.Controls
If TypeOf L Is ListBox Then
L.ForeColor = GetSetting("COLOR", "Optionen", "L.ForeColor", Default)
End If
Next L
For Each L In Form2.Controls
If TypeOf L Is ListBox Then
L.ForeColor = GetSetting("COLOR", "Optionen", "L.ForeColor", Default)
End If
Next L
For Each L In Form3.Controls
If TypeOf L Is ListBox Then
L.ForeColor = GetSetting("COLOR", "Optionen", "L.ForeColor", Default)
End If
Next L
For Each L In Form4.Controls
If TypeOf L Is ListBox Then
L.ForeColor = GetSetting("COLOR", "Optionen", "L.ForeColor", Default)
End If
Next L
For Each L In Form5.Controls
If TypeOf L Is ListBox Then
L.ForeColor = GetSetting("COLOR", "Optionen", "L.ForeColor", Default)
End If
Next L
For Each L In Form6.Controls
If TypeOf L Is ListBox Then
L.ForeColor = GetSetting("COLOR", "Optionen", "L.ForeColor", Default)
End If
Next L
End Sub
Private Sub ListeVordergrundFarbeOut()
Dim L As Control
For Each L In frmFarbOptionen.Controls
If TypeOf L Is ListBox Then
SaveSetting "COLOR", "Optionen", "L.ForeColor", L.ForeColor
End If
Next L
For Each L In Form1.Controls
If TypeOf L Is ListBox Then
SaveSetting "COLOR", "Optionen", "L.ForeColor", L.ForeColor
End If
Next L
For Each L In Form2.Controls
If TypeOf L Is ListBox Then
SaveSetting "COLOR", "Optionen", "L.ForeColor", L.ForeColor
End If
Next L
For Each L In Form3.Controls
If TypeOf L Is ListBox Then
SaveSetting "COLOR", "Optionen", "L.ForeColor", L.ForeColor
End If
Next L
For Each L In Form4.Controls
If TypeOf L Is ListBox Then
SaveSetting "COLOR", "Optionen", "L.ForeColor", L.ForeColor
End If
Next L
For Each L In Form5.Controls
If TypeOf L Is ListBox Then
SaveSetting "COLOR", "Optionen", "L.ForeColor", L.ForeColor
End If
Next L
For Each L In Form6.Controls
If TypeOf L Is ListBox Then
SaveSetting "COLOR", "Optionen", "L.ForeColor", L.ForeColor
End If
Next L
End Sub
Private Sub cmdListeVordergrund_Click() 'cmd
On Local Error Resume Next
With CommonDialog1
.CancelError = True
.ShowColor
If Err = 0 Then
Dim L As Control
For Each L In frmFarbOptionen.Controls
If TypeOf L Is ListBox Then
L.ForeColor = CommonDialog1.Color
End If
Next L
For Each L In Form1.Controls
If TypeOf L Is ListBox Then
L.ForeColor = CommonDialog1.Color
End If
Next L
For Each L In Form2.Controls
If TypeOf L Is ListBox Then
L.ForeColor = CommonDialog1.Color
End If
Next L
For Each L In Form3.Controls
If TypeOf L Is ListBox Then
L.ForeColor = CommonDialog1.Color
End If
Next L
For Each L In Form4.Controls
If TypeOf L Is ListBox Then
L.ForeColor = CommonDialog1.Color
End If
Next L
For Each L In Form5.Controls
If TypeOf L Is ListBox Then
L.ForeColor = CommonDialog1.Color
End If
Next L
For Each L In Form6.Controls
If TypeOf L Is ListBox Then
L.ForeColor = CommonDialog1.Color
End If
Next L
End If
End With
End Sub
' ################################################ Fenster! #################
Private Sub FensterSizeIn() ' <------ Einlesen!
Dim t As Control
Dim Default As Integer
Default = 8
For Each t In frmFarbOptionen.Controls
If TypeOf t Is TextBox Then
t.BackColor = GetSetting("COLOR", "Optionen", "t.BackColor", Default)
t.ForeColor = GetSetting("COLOR", "Optionen", "t.ForeColor", Default)
t.FontSize = Val(GetSetting("COLOR", "Optionen", "t.FontSize", CStr(Default))) ' FontSize einlesen!
t.FontBold = CBool(GetSetting("COLOR", "Optionen", "t.FontBold", CStr(Default))) ' FontBold einlesen!
t.FontItalic = CBool(GetSetting("COLOR", "Optionen", "t.FontItalic", CStr(Default))) ' FontItalic einlesen!
End If
Next t
For Each t In Form1.Controls
If TypeOf t Is TextBox Then
t.BackColor = GetSetting("COLOR", "Optionen", "t.BackColor", Default)
t.ForeColor = GetSetting("COLOR", "Optionen", "t.ForeColor", Default)
t.FontSize = Val(GetSetting("COLOR", "Optionen", "t.FontSize", CStr(Default))) ' FontSize einlesen!
t.FontBold = CBool(GetSetting("COLOR", "Optionen", "t.FontBold", CStr(Default))) ' FontBold einlesen!
t.FontItalic = CBool(GetSetting("COLOR", "Optionen", "t.FontItalic", CStr(Default))) ' FontItalic einlesen!
End If
Next t
For Each t In Form2.Controls
If TypeOf t Is TextBox Then
t.BackColor = GetSetting("COLOR", "Optionen", "t.BackColor", Default)
t.ForeColor = GetSetting("COLOR", "Optionen", "t.ForeColor", Default)
t.FontSize = Val(GetSetting("COLOR", "Optionen", "t.FontSize", CStr(Default))) ' FontSize einlesen!
t.FontBold = CBool(GetSetting("COLOR", "Optionen", "t.FontBold", CStr(Default))) ' FontBold einlesen!
t.FontItalic = CBool(GetSetting("COLOR", "Optionen", "t.FontItalic", CStr(Default))) ' FontItalic einlesen!
End If
Next t
For Each t In Form3.Controls
If TypeOf t Is TextBox Then
t.BackColor = GetSetting("COLOR", "Optionen", "t.BackColor", Default)
t.ForeColor = GetSetting("COLOR", "Optionen", "t.ForeColor", Default)
t.FontSize = Val(GetSetting("COLOR", "Optionen", "t.FontSize", CStr(Default))) ' FontSize einlesen!
t.FontBold = CBool(GetSetting("COLOR", "Optionen", "t.FontBold", CStr(Default))) ' FontBold einlesen!
t.FontItalic = CBool(GetSetting("COLOR", "Optionen", "t.FontItalic", CStr(Default))) ' FontItalic einlesen!
End If
Next t
For Each t In Form4.Controls
If TypeOf t Is TextBox Then
t.BackColor = GetSetting("COLOR", "Optionen", "t.BackColor", Default)
t.ForeColor = GetSetting("COLOR", "Optionen", "t.ForeColor", Default)
t.FontSize = Val(GetSetting("COLOR", "Optionen", "t.FontSize", CStr(Default))) ' FontSize einlesen!
t.FontBold = CBool(GetSetting("COLOR", "Optionen", "t.FontBold", CStr(Default))) ' FontBold einlesen!
t.FontItalic = CBool(GetSetting("COLOR", "Optionen", "t.FontItalic", CStr(Default))) ' FontItalic einlesen!
End If
Next t
For Each t In Form5.Controls
If TypeOf t Is TextBox Then
t.BackColor = GetSetting("COLOR", "Optionen", "t.BackColor", Default)
t.ForeColor = GetSetting("COLOR", "Optionen", "t.ForeColor", Default)
t.FontSize = Val(GetSetting("COLOR", "Optionen", "t.FontSize", CStr(Default))) ' FontSize einlesen!
t.FontBold = CBool(GetSetting("COLOR", "Optionen", "t.FontBold", CStr(Default))) ' FontBold einlesen!
t.FontItalic = CBool(GetSetting("COLOR", "Optionen", "t.FontItalic", CStr(Default))) ' FontItalic einlesen!
End If
Next t
For Each t In Form6.Controls
If TypeOf t Is TextBox Then
t.BackColor = GetSetting("COLOR", "Optionen", "t.BackColor", Default)
t.ForeColor = GetSetting("COLOR", "Optionen", "t.ForeColor", Default)
t.FontSize = Val(GetSetting("COLOR", "Optionen", "t.FontSize", CStr(Default))) ' FontSize einlesen!
t.FontBold = CBool(GetSetting("COLOR", "Optionen", "t.FontBold", CStr(Default))) ' FontBold einlesen!
t.FontItalic = CBool(GetSetting("COLOR", "Optionen", "t.FontItalic", CStr(Default))) ' FontItalic einlesen!
End If
Next t
End Sub
Private Sub FensterSizeOut() ' <------ Speichern!
Dim t As Control
For Each t In frmFarbOptionen.Controls
If TypeOf t Is TextBox Then
SaveSetting "COLOR", "Optionen", "t.BackColor", t.BackColor
SaveSetting "COLOR", "Optionen", "t.ForeColor", t.ForeColor
SaveSetting "COLOR", "Optionen", "t.FontSize", CStr(t.FontSize) ' FontSize speichern!
SaveSetting "COLOR", "Optionen", "t.FontBold", CStr(t.FontBold) ' FontBold speichern!
SaveSetting "COLOR", "Optionen", "t.FontItalic", CStr(t.FontItalic) ' FontItalic speichern!
End If
Next t
For Each t In Form1.Controls
If TypeOf t Is TextBox Then
SaveSetting "COLOR", "Optionen", "t.BackColor", t.BackColor
SaveSetting "COLOR", "Optionen", "t.ForeColor", t.ForeColor
SaveSetting "COLOR", "Optionen", "t.FontSize", CStr(t.FontSize) ' FontSize speichern!
SaveSetting "COLOR", "Optionen", "t.FontBold", CStr(t.FontBold) ' FontBold speichern!
SaveSetting "COLOR", "Optionen", "t.FontItalic", CStr(t.FontItalic) ' FontItalic speichern!
End If
Next t
For Each t In Form2.Controls
If TypeOf t Is TextBox Then
SaveSetting "COLOR", "Optionen", "t.BackColor", t.BackColor
SaveSetting "COLOR", "Optionen", "t.ForeColor", t.ForeColor
SaveSetting "COLOR", "Optionen", "t.FontSize", CStr(t.FontSize) ' FontSize speichern!
SaveSetting "COLOR", "Optionen", "t.FontBold", CStr(t.FontBold) ' FontBold speichern!
SaveSetting "COLOR", "Optionen", "t.FontItalic", CStr(t.FontItalic) ' FontItalic speichern!
End If
Next t
For Each t In Form3.Controls
If TypeOf t Is TextBox Then
SaveSetting "COLOR", "Optionen", "t.BackColor", t.BackColor
SaveSetting "COLOR", "Optionen", "t.ForeColor", t.ForeColor
SaveSetting "COLOR", "Optionen", "t.FontSize", CStr(t.FontSize) ' FontSize speichern!
SaveSetting "COLOR", "Optionen", "t.FontBold", CStr(t.FontBold) ' FontBold speichern!
SaveSetting "COLOR", "Optionen", "t.FontItalic", CStr(t.FontItalic) ' FontItalic speichern!
End If
Next t
For Each t In Form4.Controls
If TypeOf t Is TextBox Then
SaveSetting "COLOR", "Optionen", "t.BackColor", t.BackColor
SaveSetting "COLOR", "Optionen", "t.ForeColor", t.ForeColor
SaveSetting "COLOR", "Optionen", "t.FontSize", CStr(t.FontSize) ' FontSize speichern!
SaveSetting "COLOR", "Optionen", "t.FontBold", CStr(t.FontBold) ' FontBold speichern!
SaveSetting "COLOR", "Optionen", "t.FontItalic", CStr(t.FontItalic) ' FontItalic speichern!
End If
Next t
For Each t In Form5.Controls
If TypeOf t Is TextBox Then
SaveSetting "COLOR", "Optionen", "t.BackColor", t.BackColor
SaveSetting "COLOR", "Optionen", "t.ForeColor", t.ForeColor
SaveSetting "COLOR", "Optionen", "t.FontSize", CStr(t.FontSize) ' FontSize speichern!
SaveSetting "COLOR", "Optionen", "t.FontBold", CStr(t.FontBold) ' FontBold speichern!
SaveSetting "COLOR", "Optionen", "t.FontItalic", CStr(t.FontItalic) ' FontItalic speichern!
End If
Next t
For Each t In Form6.Controls
If TypeOf t Is TextBox Then
SaveSetting "COLOR", "Optionen", "t.BackColor", t.BackColor
SaveSetting "COLOR", "Optionen", "t.ForeColor", t.ForeColor
SaveSetting "COLOR", "Optionen", "t.FontSize", CStr(t.FontSize) ' FontSize speichern!
SaveSetting "COLOR", "Optionen", "t.FontBold", CStr(t.FontBold) ' FontBold speichern!
SaveSetting "COLOR", "Optionen", "t.FontItalic", CStr(t.FontItalic) ' FontItalic speichern!
End If
Next t
End Sub
Private Sub cmdSchriftartFenster_Click() 'cmd
On Local Error Resume Next
With CommonDialogSchriftart
.CancelError = True
If Err = 0 Then
.FontBold = Text1.FontBold
.FontName = Text1.FontName
.FontItalic = Text1.FontItalic
.FontSize = Text1.FontSize
.Flags = cdlCFBoth Or &H200000 Or &H100000
.ShowFont
End If
End With
Dim t As Control
For Each t In frmFarbOptionen.Controls
If TypeOf t Is TextBox Then
t.Font.Name = CommonDialogSchriftart.FontName
t.Font.Bold = CommonDialogSchriftart.FontBold
t.Font.Size = CommonDialogSchriftart.FontSize
t.Font.Italic = CommonDialogSchriftart.FontItalic
End If
Next t
For Each t In Form1.Controls
If TypeOf t Is TextBox Then
t.Font.Name = CommonDialogSchriftart.FontName
t.Font.Bold = CommonDialogSchriftart.FontBold
t.Font.Size = CommonDialogSchriftart.FontSize
t.Font.Italic = CommonDialogSchriftart.FontItalic
End If
Next t
For Each t In Form2.Controls
If TypeOf t Is TextBox Then
t.Font.Name = CommonDialogSchriftart.FontName
t.Font.Bold = CommonDialogSchriftart.FontBold
t.Font.Size = CommonDialogSchriftart.FontSize
t.Font.Italic = CommonDialogSchriftart.FontItalic
End If
Next t
For Each t In Form3.Controls
If TypeOf t Is TextBox Then
t.Font.Name = CommonDialogSchriftart.FontName
t.Font.Bold = CommonDialogSchriftart.FontBold
t.Font.Size = CommonDialogSchriftart.FontSize
t.Font.Italic = CommonDialogSchriftart.FontItalic
End If
Next t
For Each t In Form4.Controls
If TypeOf t Is TextBox Then
t.Font.Name = CommonDialogSchriftart.FontName
t.Font.Bold = CommonDialogSchriftart.FontBold
t.Font.Size = CommonDialogSchriftart.FontSize
t.Font.Italic = CommonDialogSchriftart.FontItalic
End If
Next t
For Each t In Form5.Controls
If TypeOf t Is TextBox Then
t.Font.Name = CommonDialogSchriftart.FontName
t.Font.Bold = CommonDialogSchriftart.FontBold
t.Font.Size = CommonDialogSchriftart.FontSize
t.Font.Italic = CommonDialogSchriftart.FontItalic
End If
Next t
For Each t In Form6.Controls
If TypeOf t Is TextBox Then
t.Font.Name = CommonDialogSchriftart.FontName
t.Font.Bold = CommonDialogSchriftart.FontBold
t.Font.Size = CommonDialogSchriftart.FontSize
t.Font.Italic = CommonDialogSchriftart.FontItalic
End If
Next t
End Sub
Private Sub cmdFensterHintergrund_Click()
On Local Error Resume Next
With CommonDialog1
.CancelError = True
.ShowColor
If Err = 0 Then
Dim t As Control
For Each t In frmFarbOptionen.Controls
If TypeOf t Is TextBox Then
t.BackColor = CommonDialog1.Color
End If
Next t
For Each t In Form1.Controls
If TypeOf t Is TextBox Then
t.BackColor = CommonDialog1.Color
End If
Next t
For Each t In Form2.Controls
If TypeOf t Is TextBox Then
t.BackColor = CommonDialog1.Color
End If
Next t
For Each t In Form3.Controls
If TypeOf t Is TextBox Then
t.BackColor = CommonDialog1.Color
End If
Next t
For Each t In Form4.Controls
If TypeOf t Is TextBox Then
t.BackColor = CommonDialog1.Color
End If
Next t
For Each t In Form5.Controls
If TypeOf t Is TextBox Then
t.BackColor = CommonDialog1.Color
End If
Next t
For Each t In Form6.Controls
If TypeOf t Is TextBox Then
t.BackColor = CommonDialog1.Color
End If
Next t
End If
End With
End Sub
Private Sub cmdFensterVordergrund_Click() 'cmd
On Local Error Resume Next
With CommonDialog1
.CancelError = True
.ShowColor
If Err = 0 Then
Dim t As Control
For Each t In frmFarbOptionen.Controls
If TypeOf t Is TextBox Then
t.ForeColor = CommonDialog1.Color
End If
Next t
For Each t In Form1.Controls
If TypeOf t Is TextBox Then
t.ForeColor = CommonDialog1.Color
End If
Next t
For Each t In Form2.Controls
If TypeOf t Is TextBox Then
t.ForeColor = CommonDialog1.Color
End If
Next t
For Each t In Form3.Controls
If TypeOf t Is TextBox Then
t.ForeColor = CommonDialog1.Color
End If
Next t
For Each t In Form4.Controls
If TypeOf t Is TextBox Then
t.ForeColor = CommonDialog1.Color
End If
Next t
For Each t In Form5.Controls
If TypeOf t Is TextBox Then
t.ForeColor = CommonDialog1.Color
End If
Next t
For Each t In Form6.Controls
If TypeOf t Is TextBox Then
t.ForeColor = CommonDialog1.Color
End If
Next t
End If
End With
End Sub
gruß, alert |