Yes/No ComboBox

S

Scott M.

If it needs only Y & N, shouldn't it be a boolean control or a listbox
control, but not a ComboBox control?

Using a ComboBox for this, I would say, is a good example of a poorly
designed UI. UI's should be easy to use and understand for users. Users
don't expect ComboBoxes for Y & N answers.

Is there some reason why you feel you need a ComboBox for this?
 
H

Herfried K. Wagner [MVP]

Scott M. said:
If it needs only Y & N, shouldn't it be a boolean control or a listbox
control, but not a ComboBox control?

I'd use a checkbox control ("boolean control") :).
 
C

Chris

I have a need to have a combo box that just has Yes & No as it options.
This will be used everywhere in the application, so I thought I would
make a control that inherits from combobox. I am having trouble
figuring out how to add the Y/N in control. I tried:


Public Class YesNoCombobox
Inherits ComboBox
Sub New()
MyBase.New()
If Me.Items.Count = 0 Then
Me.Items.Add("N - No")
Me.Items.Add("Y - Yes")
End If
End Sub
End Class

This doubles the N/Y because the designer places a N/Y in the designer
code as well. Anyone have thoughts on how to do this?

Chris
 
C

Chris

Scott said:
If it needs only Y & N, shouldn't it be a boolean control or a listbox
control, but not a ComboBox control?

Using a ComboBox for this, I would say, is a good example of a poorly
designed UI. UI's should be easy to use and understand for users. Users
don't expect ComboBoxes for Y & N answers.

Is there some reason why you feel you need a ComboBox for this?

Yes, thank you for your concern on my design, but we are duplicating a
functionality that already exists. They like the way it is and it is
not worth fighting to change it. It works well and it I still would
like a solution.

Chris
 
A

Ahmed

At the end it is what the customer wants. If they like it a combo box
it must be a combobox :)

Chris try the follwoing:

Protected Overrides Sub InitLayout()
MyBase.InitLayout()

If Me.Items.Count = 0 Then
Me.Items.Add("Yes")
Me.Items.Add("No")
End If
End Sub

It worked for me.

Cheers,
 
C

Cor Ligthert [MVP]

Ahmed,

At the end it is what the customer tells when they have chosen another shop.

By instance that those had a more from this time solution with an easier way
of handling by instance the UI commands, which saved them a lot of time.

Just my thought reading your message.

Cor
 
A

Ahmed

I guess you will be losing many customers :p

when it comes to creating programs in house and dealing with
non-technical personnel it becomes even worse.
 
M

Michael D. Ober

Even MS doesn't follow this suggestion. Take a look at the properties page
for various controls (text edit for example) and you will see multiple
instances of properties marked Yes/No or True/False that are combo boxes and
not checkboxes.

Mike Ober.
 
S

Simon Verona

I tend to you comboboxes for "yes/no" where I need to record the third state
(ie unselected). Sometimes in a form, I want the user to specifically make
a choice, rather than perhaps forget and take the default. I find the
combobox better than the checkbox for this purpose.

Having said that the checkbox is more the norm. for yes/no true/false
boolean tests.

Simon

--
================================
Simon Verona
Dealer Management Service Ltd
Stewart House
Centurion Business Park
Julian Way
Sheffield
S9 1GD

Tel: 0870 080 2300
Fax: 0870 735 0011
 
C

Cor Ligthert [MVP]

Michael,

Do you use Version 2003, if you have ever opened an "add reference dialog
box", you would never write anymore than *even*. However there has been a
suggestion to do that better and the boxes in the VBNet windowsform IDE
version 2005 are now completely resizable.

To say it in other words, it are just normal developers who make the same
mistakes as you and me, but change things when there is put their attention
on it..

Just my thought,

Cor
 
G

GhostInAK

Hello Chris,

All this talk of checkboxes.. For purely Yes/No selections (for which Yes
is mutually exclusive of No) radiobuttons are the correct control. If the
user can select both Yes and No, then three radiobuttons (Yes, No, Mabey)
is better. Perhaps ya'll were thinking of a single checkbox.. which would
work as well.. but it doesn't convey the same Yes/No UI option that a Y/N
combobox would.

-Boo
 
H

Herfried K. Wagner [MVP]

GhostInAK said:
All this talk of checkboxes.. For purely Yes/No selections (for which Yes
is mutually exclusive of No) radiobuttons are the correct control.

How do you come to this perception?!
 
S

Scott M.

Yes, but those listboxes are nested within a larger context. To say that
even MS doesn't follow this suggestion is incorrect.
 
S

Scott M.

When I pay my bills online, I am forced to check a single checkbox,
indicating that "Yes", I have read and agree to the terms and conditions of
that web site. If I don't check the checkbox, it means that "No", I don't.

The single checkbox solution is just as valid as the Yes & No radiobutton
solution.

All I suggested was that a "Boolean" control would be best. Both checkboxes
and radiobuttons are Boolean.
 
G

GhostInAK

Hello GhostInAK,

My appologies. I meant in the context of providing both Yes and No as UI
elements (as the combobox would have done).

Some days I forget to type a letter.. some days I gotget to type a word..
other days I forget to type whole paragraphs.

-Boo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top