Hallo tox,
die Methode class_initialize() ist ähnlich wie bei Java ein Konstruktor. Der Destruktor wäre class_terminate().
Innerhalb einer Methode können, wie in Java auch, keine weiteren Methoden platziert werden, die müsstest Du auslagern.
Die Select Case Anweisung benötigt hinter dem Auswahlkriterium ein Doppelpunkt.
Angenommen, Du hast die ComboBox in einem Formular platziert, dann könnte der Code wie folgt aussehen:
Private a As String
Private b As String
Private c As String
Private Sub FillComboBox(a, b, c)
ComboBox1.AddItem a
ComboBox1.AddItem b
ComboBox1.AddItem c
End Sub
Private Sub ComboBox1_GotFocus()
a = "Text1"
b = "Text2"
c = "Text3"
Call FillComboBox(a, b, c)
End Sub
Private Sub ComboBox1_Change()
Select Case Me.ComboBox1.Value
Case a: Call M1
Case b: Call M2
Case c: Call M3
End Select
End Sub
Private Sub M1()
Call MsgBox("Bin in M1()", vbOKOnly)
End Sub
Private Sub M2()
Call MsgBox("Bin in M2()", vbOKOnly)
End Sub
Private Sub M3()
Call MsgBox("Bin in M3()", vbOKOnly)
End Sub
|