Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

check if combo box has selection vb.net

Posted on 2016-08-01
5
182 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
ID: 41737456
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
ID: 41737457
apart from the blinding obvious that i need an else and need to move the call to the correct part
0
 
LVL 63

Accepted Solution

by:
Fernando Soto earned 500 total points
ID: 41737468
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
ID: 41737472
I did try and ceremoniously failed. thx again
0
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 41737474
Did you get it working?
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

792 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