Solved

check if combo box has selection vb.net

Posted on 2016-08-01
5
66 Views
Last Modified: 2016-08-01
i have 3 combo boxes on a form  in vb.net. the 3rd combo needs the selection from both of the previous. How do i check that both cb1 and 2 have items selected?
there is no order of selection the user can change 1 or 2 in either order as long as i can make cb3 respond
0
Comment
Question by:PeterBaileyUk
  • 3
  • 2
5 Comments
 

Author Comment

by:PeterBaileyUk
Comment Utility
I just wrote this
  If (String.IsNullOrEmpty(CBNote.SelectedItem)) And (String.IsNullOrEmpty(CBScaleType.SelectedItem)) Then
            Call GetCBData("usp_GetChords")
        End If

not sure if its correct way
0
 

Author Comment

by:PeterBaileyUk
Comment Utility
apart from the blinding obvious that i need an else and need to move the call to the correct part
0
 
LVL 62

Accepted Solution

by:
Fernando Soto earned 500 total points
Comment Utility
You can use the ComboBox.SelectedIndex property to know if a item has been selected in the ComboBox. It returns the zero base index of the selected item or if no item has been selected -1.
0
 

Author Closing Comment

by:PeterBaileyUk
Comment Utility
I did try and ceremoniously failed. thx again
0
 
LVL 62

Expert Comment

by:Fernando Soto
Comment Utility
Did you get it working?
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now