Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming

Reply
 
LinkBack Thread Tools
Old 08-25-06   #1 (permalink)
4.0 GHz
 
guitar22891's Avatar
 
intel nvidia

Join Date: Feb 2006
Location: Florida
Posts: 997

Rep: 46 guitar22891 is acknowledged by some
Unique Rep: 38
FAQs Submitted: 4
Trader Rating: 0
Default listbox in VB

Well I have 2 listboxes right? so how do I make it so when I select a thing from the listbox1 it displays the list pertaining to the item selected it in listbox2. And if I selected a different item from listbox1 it displays a different list in listbox2?
__________________
Future Upgrades:
  • Another 1gb of GSKILL DDR500
  • Better Graphics Card
Jesus is my Savior

System: My System
CPU
3.0E E0 Presscott @ 3.85
Motherboard
P4P800 SE
Memory
1GB DDR500 Gskill HZ
Graphics Card
FX5500 256mb 128bit AGP
Hard Drive
200GB Sata1.5 Maxtor
Sound Card
Onboard
Power Supply
400w FSP-PN
Case
Xoxide 5 in 1 combo
OS
Windows XP Home & Ubuntu
Monitor
19in Flat Panel
guitar22891 is offline   Reply With Quote
Old 08-25-06   #2 (permalink)
110100001101001111000
 
C-bro's Avatar
 
intel nvidia

Join Date: Jan 2006
Location: Hamilton, ON
Posts: 1,832

Rep: 283 C-bro is a proven memberC-bro is a proven memberC-bro is a proven member
Unique Rep: 215
FAQs Submitted: 6
Folding Team Rank: 237
Hardware Reviews: 9
Trader Rating: 1
Default

I know nothing of VB, but in Java you generally use an array to specify the contents of a list box, or button labels or whatever. You also use events to catch certain commands and stuff.

I would make an event handler so that when an option in list1 is selected, it allows list2 to display the array of items that corresponds to the choice in list one. Not the greatest explanation, but I'm not exactly sure what VB can do.

Sort of:

list1 list2
option1 -> arrayOfOptions1
option2 -> arrayOfOptions2

System: RAID0R
CPU
Intel E2180 3.33GHz
Motherboard
Asus P5K-E/WIFI-AP vMod
Memory
2GB Kingmax DDR2-1066
Graphics Card
EVGA 8800GT
Hard Drive
2x250GB WD+500GB 7200.11
Sound Card
SB Audigy 2
Power Supply
Corsair CMPSU-550VX
CPU cooling
Arctic Cooling Freezer 7 Pro
GPU cooling
Zalman VF900-Cu
OS
Windows Vista Business 32-Bit
Monitor
HP F2105 21" & Samsung 712N
C-bro is offline I fold for Overclock.net Overclocked Account C-bro's Gallery   Reply With Quote
Old 08-25-06   #3 (permalink)
4.0 GHz
 
guitar22891's Avatar
 
intel nvidia

Join Date: Feb 2006
Location: Florida
Posts: 997

Rep: 46 guitar22891 is acknowledged by some
Unique Rep: 38
FAQs Submitted: 4
Trader Rating: 0
Default

Quote:
Originally Posted by C-bro
I know nothing of VB, but in Java you generally use an array to specify the contents of a list box, or button labels or whatever. You also use events to catch certain commands and stuff.

I would make an event handler so that when an option in list1 is selected, it allows list2 to display the array of items that corresponds to the choice in list one. Not the greatest explanation, but I'm not exactly sure what VB can do.

Sort of:

list1 list2
option1 -> arrayOfOptions1
option2 -> arrayOfOptions2
I figured I have to use an array but I really don't know the code to do this...
__________________
Future Upgrades:
  • Another 1gb of GSKILL DDR500
  • Better Graphics Card
Jesus is my Savior

System: My System
CPU
3.0E E0 Presscott @ 3.85
Motherboard
P4P800 SE
Memory
1GB DDR500 Gskill HZ
Graphics Card
FX5500 256mb 128bit AGP
Hard Drive
200GB Sata1.5 Maxtor
Sound Card
Onboard
Power Supply
400w FSP-PN
Case
Xoxide 5 in 1 combo
OS
Windows XP Home & Ubuntu
Monitor
19in Flat Panel
guitar22891 is offline   Reply With Quote
Old 08-26-06   #4 (permalink)
Bifford
 
BFRD's Avatar
 
intel nvidia

Join Date: Dec 2004
Location: Carrollton, TX
Posts: 4,336

FAQs Submitted: 8
Folding Team Rank: 27
Hardware Reviews: 2
Trader Rating: 11
Default

Is this VB6 or VB.NET?
__________________
Helpful Posts (Hopefully )
Overclocker's Calculator
Photo Editing - B&W w/Color Accents

System: Main Rig
CPU
E6700 Conroe
Motherboard
Abit QuadGT
Memory
2GB G.Skill PC2 8000 (HZ)
Graphics Card
EVGA 8800GTX
Hard Drive
150 GB Raptor X / 300GB Storage
Sound Card
Audigy 2 ZS
Power Supply
PCP&C Silencer 750
Case
Sigma Shark
CPU cooling
Stock (for now)
GPU cooling
Stock
OS
Vista Ultimate
Monitor
Dual Samsung 204b
BFRD is offline I fold for Overclock.net Overclocked Account BFRD's Gallery   Reply With Quote
Old 08-26-06   #5 (permalink)
Intel oc'er in training
 
intel ati

Join Date: Jun 2004
Location: Herts, UK
Posts: 2,562

Rep: 207 Zeus is acknowledged by manyZeus is acknowledged by manyZeus is acknowledged by many
Unique Rep: 142
Trader Rating: 0
Default

Here's a simple version of the code I've used in the past for VB.NET. It might also work in VB6

Hope it helps.

Code:
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.FillListBox1()
        Me.ListBox2.Items.Clear()
    End Sub

    Private Sub FillListBox1()

        With Me.ListBox1
            .Items.Clear()
            .Items.Add("List 1")
            .Items.Add("List 2")
        End With
    End Sub

    Private Sub ListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged

        Select Case Me.ListBox1.SelectedIndex
            Case 0
                With Me.ListBox2
                    .Items.Clear()
                    .Items.Add("List 1 - Item 1")
                    .Items.Add("List 1 - Item 2")
                End With
            Case 1
                With Me.ListBox2
                    .Items.Clear()
                    .Items.Add("List 2 - Item 1")
                    .Items.Add("List 2 - Item 2")
                End With
        End Select
    End Sub

End Class
__________________
E6600 L717A @ 3560Mhz CPUz validated --> ID 242627

X1950 scores: AM3: 126900 | 3DMark01: 45167 | 3DMark03: 20353 | 3DMark05: 11822 | 3DMark06: 5954

...Gaming rig being rebuilt after new mobo...

System: Gaming Rig
CPU
E6600 L717A
Motherboard
Gigabyte GA-P35-DS3
Memory
A-Data DDR2 PC6400 (2x1GBMB)
Graphics Card
HD 4870 1024MB GDDR5
Hard Drive
Maxtor 250Gb 16Mb PATA
Sound Card
Onboard
Power Supply
Antec TPQ 850W modular
Case
PoS
CPU cooling
Zalman CNPS9500 LED
GPU cooling
Stock
OS
WinXP 32bit SP2
Monitor
Fujitsu CRT 19"
Zeus is offline Overclocked Account   Reply With Quote
Old 08-26-06   #6 (permalink)
4.0 GHz
 
guitar22891's Avatar
 
intel nvidia

Join Date: Feb 2006
Location: Florida
Posts: 997

Rep: 46 guitar22891 is acknowledged by some
Unique Rep: 38
FAQs Submitted: 4
Trader Rating: 0
Default

I use visual studio 2005 I think its based off VB6? but thanks Zeus... I'll try the code out...
__________________
Future Upgrades:
  • Another 1gb of GSKILL DDR500
  • Better Graphics Card
Jesus is my Savior

System: My System
CPU
3.0E E0 Presscott @ 3.85
Motherboard
P4P800 SE
Memory
1GB DDR500 Gskill HZ
Graphics Card
FX5500 256mb 128bit AGP
Hard Drive
200GB Sata1.5 Maxtor
Sound Card
Onboard
Power Supply
400w FSP-PN
Case
Xoxide 5 in 1 combo
OS
Windows XP Home & Ubuntu
Monitor
19in Flat Panel
guitar22891 is offline   Reply With Quote
Old 08-26-06   #7 (permalink)
Bifford
 
BFRD's Avatar
 
intel nvidia

Join Date: Dec 2004
Location: Carrollton, TX
Posts: 4,336

FAQs Submitted: 8
Folding Team Rank: 27
Hardware Reviews: 2
Trader Rating: 11
Default

That is VB.NET v2
__________________
Helpful Posts (Hopefully )
Overclocker's Calculator
Photo Editing - B&W w/Color Accents

System: Main Rig
CPU
E6700 Conroe
Motherboard
Abit QuadGT
Memory
2GB G.Skill PC2 8000 (HZ)
Graphics Card
EVGA 8800GTX
Hard Drive
150 GB Raptor X / 300GB Storage
Sound Card
Audigy 2 ZS
Power Supply
PCP&C Silencer 750
Case
Sigma Shark
CPU cooling
Stock (for now)
GPU cooling
Stock
OS
Vista Ultimate
Monitor
Dual Samsung 204b
BFRD is offline I fold for Overclock.net Overclocked Account BFRD's Gallery   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -4. The time now is 02:16 PM.


Overclock.net is a Carbon Neutral Site Creative Commons License Internet Security By ControlScan

Terms of Service / Forum Rules | Privacy Policy | Advertising | Become an Official Vendor
Copyright © 2008 Shogun Interactive Development. Most rights reserved.
Page generated in 0.30520 seconds with 8 queries