Solved

c# validation on combo boxes

Posted on 2014-01-12
2
246 Views
Last Modified: 2014-03-18
Hi,

I have 4 combo boxes

the default value is "-- Please Select --", i want a validation that says

1) Only one can be set NOT to  "-- Please Select --" the rest 3 have TO be set to  "-- Please Select --"

Please help

Thanks

R8vI
0
Comment
Question by:R8VI
[X]
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
2 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 39774693
I think you should look for some control alternative like this:
a combo box with a "tree-view" like display
http://www.brad-smith.info/blog/archives/104
will be easier for the user, I would say?
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 39775052
Dim count As Integer

            count = CInt(ComboBox1.Text = "-- Please Select --")
            count += CInt(ComboBox2.Text = "-- Please Select --")
            count += CInt(ComboBox3.Text = "-- Please Select --")
            count += CInt(ComboBox4.Text = "-- Please Select --")

            If count <> -3 Then
                  MessageBox.Show("Bad")
            End If
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Suggested Solutions

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

762 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