Radio button Link to ListBoxt

xswzaq

Well-known member
Joined
Jul 9, 2007
Messages
61
Programming Experience
Beginner
I have two radio button, one list box and a searchbtn on my form. The listbox is right next to my 2nd radiobutton. My 1st radiobutton is ALL and the 2nd one is Individual. If user choose 1st radiobutton(ALL) I want to it to choose all choices in listbox, so when users click searchbtn, it will go and search record which contain for all choice in listbox. And if users click 2nd radiobutton(Individual), I want it to automatically choose the first choice in the listbox (but user can also select different choices) and click searchbtn, the it will only go out and search for the selected choice in listbox. Is there a way/code to do it?

I appricates any guidances.
 
Can you be more specific. In the listbox, I don't know how to use the methods you mention and I have these code to help me selected, but the 1radiobutton(ALL) did not work. the 2nd radiobutton work fine for me now.

Private Sub CCNSALLbinradbtn_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CCNSALLbinradbtn.CheckedChanged
For i As Integer = 0 To Me.CCNSBinLstBox.Items.Count - 1
Me.CCNSBinLstBox.SetSelected(i, True)
Next
End Sub
 
My apologies. I looked in the MSDN documentation but I didn't notice that SelectAll is only a member of the new .NET 3.0 System.Windows.Controls.ListBox, not the existing System.Windows.Forms.ListBox that you're using.
 
Back
Top