Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
2
Answers
Check if 2 listboxes have selected items
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Steven Sandford
9y
794
1
Reply
Hi Guys,
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
Now this seems to enable my button only if an item is selected in listbox2 and then you need to click twice within listbox1 before it recognises the selection.
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
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
VB.Net Update command updating Row with last Row values
how to set default camera if we have 2 cameras connected??