|
-
Aug 24th, 2005, 10:55 PM
#1
Thread Starter
Addicted Member
Newbie Question [RESOLVED]
I have two listbox, List1 and List2. What I wanted to do is to display in list2 the text that I selected in list1. I tried some codes like
VB Code:
List2.ListIndex = List1.ListIndex
but it does not work ..... thanks in advance
Last edited by Zelot; Aug 24th, 2005 at 11:44 PM.
Reason: RESOLVED
-
Aug 24th, 2005, 11:06 PM
#2
Re: Newbie Question
You mean like this for VB6?
VB Code:
Option Explicit
Private Sub Form_Load()
List1.AddItem "Test1"
List1.AddItem "Test2"
List1.AddItem "Test3"
List2.AddItem "Test1"
List2.AddItem "Test2"
List2.AddItem "Test3"
End Sub
Private Sub List1_Click()
List2.ListIndex = List1.ListIndex
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 
-
Aug 24th, 2005, 11:30 PM
#3
Thread Starter
Addicted Member
Re: Newbie Question
List1 would contain all of the list while list2 won't have anything on it. What I wanted to do is when I click on an Item in List1 that Item would show on List2
-
Aug 24th, 2005, 11:36 PM
#4
Re: Newbie Question
Oh, ok then...
VB Code:
Option Explicit
Private Sub Form_Load()
List1.AddItem "Test1"
List1.AddItem "Test2"
List1.AddItem "Test3"
End Sub
Private Sub List1_Click()
List2.AddItem List1.List(List1.ListIndex)
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 
-
Aug 24th, 2005, 11:43 PM
#5
Thread Starter
Addicted Member
Re: Newbie Question
It worked thanks
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
|