Hallo,
ich habe versucht, folgenden Code zu vereinfachen:
with Hauptmaske.Listbox1
.BoundColumn=5
.ColumnCount=5
end with
with Hauptmaske
.Textbox1.Text=„Hallo“
.Button9.Visible=false
end with
jetzt mein Versuch der Vereinfachung:
Dim lb1 as Listbox
Set lb1=Listbox1
with Hauptmaske
.lb1.BoundColumn=5
.lb1.ColumnCount=5
.Textbox1.Text=„Hallo“
.Button9.Visible=false
end with
Leider meldet der Compiler bei der Verwendung von .lb1 einen Fehler. Was mache ich hier falsch?
Gruß
Pauli
Anfrage ist erledigt
…hab es selbst herausgefunden:
Hallo,
ich habe versucht, folgenden Code zu vereinfachen:
with Hauptmaske.Listbox1
.BoundColumn=5
.ColumnCount=5
end with
with Hauptmaske
.Textbox1.Text=„Hallo“
.Button9.Visible=false
end with
jetzt mein Versuch der Vereinfachung:
Dim lb1 as Listbox
Set lb1=Listbox1
with Hauptmaske
.lb1.BoundColumn=5
.lb1.ColumnCount=5
.Textbox1.Text=„Hallo“
.Button9.Visible=false
end with
Leider meldet der Compiler bei der Verwendung von .lb1 einen
Fehler. Was mache ich hier falsch?
die Lösung ist:
Dim lb1 as Object
Set lb1=Hauptmaske.Listbox1
with Hauptmaske
lb1.BoundColumn=5
lb1.ColumnCount=5
.Textbox1.Text=„Hallo“
.Button9.Visible=false
end with
Gruß
Pauli
Dim lb1 as Object
Set lb1=Hauptmaske.Listbox1
with Hauptmaske
lb1.BoundColumn=5
lb1.ColumnCount=5
.Textbox1.Text=„Hallo“
.Button9.Visible=false
end with
Hallo Pauli,
mal eine andere Variante wenn du das nicht kennst:
With Hauptmaske.ListBox1
.BoundColumn = 5
.ColumnCount = 5
.Parent.Textbox1.Text = "Hallo"
.Parent.Button9.Visible = False
End With
Gruß
Reinhard
1 „Gefällt mir“
…nein, parent habe ich noch nie verwendet, tolle Anwendung, danke dafür. Mit Deiner Hilfe habe ich enorm dazugelernt, mein Programm zu verfeinern.
Gruß
Pauli