Fairly new to VB but enjoying making a small app. One thing I am stuck on is trying to check if 2 listboxes have had an item selected.
If the 2 listboxes have an item selected then enable a button.
I have placed the following code inside the Listbox1 Click Event sub which is public.
If listbox1.selectedIndex => 0 And listbox2.selectedIndex => 0 Then
button1.enabled = True
End If
button1.enabled = True
End If
I have pieced this together just from google so if I am doing it wrong I would like to know the correct format or the most sound approach.
Thank you
Steven SandfordPosted Oct 8, 2014, 5:11 PM
Thanks Vulpes, I managed to get this working with a little help
I created a single method with the above code, and then passed the method through both event handlers
VulpesPosted Oct 8, 2014, 7:58 AM
Notice also that the 'greater than or equal' operator should be written the other way around i.e. >= instead of =>.