Sep 19th, 2004, 02:35 AM
#1
Thread Starter
Hyperactive Member
How To Reapeat [NOT Resolved]
Is there a way you can repeat something that just happend.
Example:
VB Code:
Private Sub Command1_Click()
ListView1.ListItems.Add 1, , OK, "leaf", "leaf"
Is There A Way I Can Reapeat The Same Thing?
Sep 19th, 2004, 03:18 AM
#2
yay gay
using a while or for / next statement?
\m/
\m/
Sep 19th, 2004, 12:14 PM
#3
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
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Sep 19th, 2004, 04:55 PM
#4
Thread Starter
Hyperactive Member
Command Button
By Pressing The Command Button
Unity Programs™ - Downloads To Make Your Computer Life Easier - UnityPrograms.com, check it out
My small company, I need feedback.
If someone's post was useful, don't forget to
Rate It by clicking the
Rate This Post link under the avatar.
If this post has been resolved. Please mark it as
Resolved by going through the
Thread Tools above and clicking on the
Mark Thread Resolved option.
We ride together, We die together, .NET for life. -
Working With Visual Studio.NET 2005
Application Deployment ,
General Developer Forum ,
Visual Basic .NET
Sep 19th, 2004, 05:04 PM
#5
Fanatic Member
Attached Files
Sep 19th, 2004, 05:58 PM
#6
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
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width