473,950 Members | 1,920 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Yes/No ComboBox

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
Jun 22 '06
14 4824
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
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

Jun 23 '06 #11
"GhostInAK" <gh*******@gmai l.com> schrieb:
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?!

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jun 23 '06 #12
Yes, but those listboxes are nested within a larger context. To say that
even MS doesn't follow this suggestion is incorrect.
"Michael D. Ober" <obermd.@.alum. mit.edu.nospam> wrote in message
news:O4******** ******@TK2MSFTN GP02.phx.gbl...

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.

"Scott M." <s-***@nospam.nosp am> wrote in message
news:up******** ******@TK2MSFTN GP05.phx.gbl...

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?

"Chris" <no@spam.com> wrote in message
news:eo******** ******@TK2MSFTN GP03.phx.gbl...
>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



Jun 23 '06 #13
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.
"GhostInAK" <gh*******@gmai l.com> wrote in message
news:be******** *************** **@news.microso ft.com...
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
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


Jun 23 '06 #14
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
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
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

Jun 23 '06 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
8564
by: Nicolae Fieraru | last post by:
Hi All, I am trying to change the rowsource of a combobox when I click on it. I played with many events, associated with the form and the combobox, but still haven't figured out what is the way of doing it. I have a table with products, tblProducts, some of them are Active while others are Inactive. The form shows all the products purchased by a customer, both Active and Inactive in a ComboBox, cbProducts. My client wants to view all...
8
12131
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the combobox. What is the solution? Thank you in advance.
1
2506
by: anonymous | last post by:
I've been trying to put a them, please help me out. Here's the major parts of my code: public Form1() { DataSet myDataSet = new DataSet("myDataSet"); DataTable testTable = new DataTable("table"); testTable.Columns.Add("Col1", typeof(Int32)); testTable.Columns.Add("Col2", typeof(String)); testTable.Rows.Add(testTable.NewRow());
3
6845
by: TT (Tom Tempelaere) | last post by:
Hay there, I'm writing my own DataGridComboBoxColumn because .NET 1.1 does not have one (I hope .NET 2.0 supplies one). I based it on this article: http://msdn.microsoft.com/msdnmag/issues/03/08/DataGrids/default.aspx I have a problem when there are two DataGrid's on one form, and when I switch focus from one grid to the other. To be more precise, when I'm editing a combo box column in one grid, and then click in the combo column of...
6
2890
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox and the coresponding 'Id' from the lookup table is to be inserted into the field of the new record. I have two simple tables. "tblPerson" is the data table. The lookup
0
10171
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9991
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11191
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10702
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9904
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7442
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6231
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4959
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4549
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.