Typename Eigenschaft
04.12.2016 15:06:59
Volkmar
Ich habe ein Collection Object dass mehrere Steuerelemente,
Textboxen, Dropdowns und Checkboxes enthält
Ich möchte nun die Value Egnenschaft aller Elemente der Collection
auf dieAusgangswerte zurücksetzen.
Das Heißt Dropdown- und Textfelder auf ""
und Checkboxen auf FALSE.
An die Typename Eigenschaft komm ich aber nur über die Controls Auflistung,
Nicht aber über mein Collection Object.
Hat dazu jemand eine Idee?
Option Explicit
Public MyCollection As New Collection
.
.
Sub Test
With MyCollection
.Add Combobox1: .Add Checkbox1: .Add Textbox1
.Add Combobox2: .Add Checkbox2: .Add Textbox2
.Add Combobox3: .Add Checkbox3: .Add Textbox3
End With
For Each Box In Girl_Property
Box.Enabled = False
Box.BackColor = Grau 'Grau ist eine Konstante
If Box.Typename = Checkbox then
Box.Value = TRUE
Else
Box.Value = ""
End If
Next
End Sub