Is there a way you can repeat something that just happend.
Example:Is There A Way I Can Reapeat The Same Thing?VB Code:
Private Sub Command1_Click() ListView1.ListItems.Add 1, , OK, "leaf", "leaf"
:confused:
Printable View
Is there a way you can repeat something that just happend.
Example:Is There A Way I Can Reapeat The Same Thing?VB Code:
Private Sub Command1_Click() ListView1.ListItems.Add 1, , OK, "leaf", "leaf"
:confused:
using a while or for / next statement?
You mean like adding the same listview item or by pressing the
command button again?
VB Code:
'Repeats 10 times Private Sub Command1_Click() Dim i as integer for i = 1 to 10 ListView1.ListItems.Add , , OK, "leaf", "leaf" next End Sub 'Repeat something that just happened one time. 'Will take two clicks in order to add a listitem. Private Sub Command1_Click() Static bHappened as Boolean bHappened = Not bHappened If bHappened = True Then ListView1.ListItems.Add , , OK, "leaf", "leaf" End If End Sub
By Pressing The Command Button
Little example
I missed some code for my second ex.
VB Code:
'Repeat something that just happened with one click. 'Will take one click but will happen twice. Private Sub Command1_Click() Static bHappened as Boolean bHappened = Not bHappened If bHappened = True Then ListView1.ListItems.Add , , OK, "leaf", "leaf" End If Call Command1_Click 'Forgot this line End Sub