I program programming, especially in Visual Basic. I only use VB6 because I have to use it for college and I am completely stuck.
I have a list in which I want to display the name of the radio, and then when I click on the name, I want it to put data in some text fields, it's simple, I know, but I donβt even know the full VB6 syntax, so I completely stuck, I asked my teacher, but he doesnβt help much.
This is the line highlighted when the debug button is clicked:
x = radCatList.ItemData(radCatList.ListIndex)
This is the code for the enitre form, again it is very simple, and I barely know what I am doing most of this project is copy and paste:
Option Explicit Private Sub Form_Load() Dim r As radioRec Dim radioChan As Integer Dim x As Integer x = 1 radioChan = FreeFile Open radioFile For Random As radioChan Len = radioLen Get radioChan, x, r Do While Not EOF(radioChan) radCatList.AddItem r.rModel radCatList.ItemData(radCatList.NewIndex) = x x = x + 1 Get radioChan, x, r Loop Close radioChan End Sub Private Sub radCatList_Click() Dim r As radioRec Dim radioChan As Integer Dim x As Integer radCatList.Clear x = radCatList.ItemData(radCatList.ListIndex) radioChan = FreeFile Open radioFile For Random As radioChan Len = radioLen Get radioChan, x, r channelTxt = r.rLicense licenseTxt = r.rLicense rangeTxt = r.rRange stockTxt.Text = r.rStock Close radioChan End Sub
source share