Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

drop down combo with check boxes

1 view
Skip to first unread message

Paul Reddy

unread,
Jul 26, 1994, 2:52:25 AM7/26/94
to
Hi
We have a client who is determined to have a selectable list
displayed using a drop down combo with check boxes. We currently
use a multiselect in the drop down - but he is determined to have
check boxes.

Does such a beast exist? (We are using VB). ie is there a
combo into which you can have two columns, one of which is
a check box?

[to those people who rightly ask "what will you display in the
text of the combo" I can only say that we will probably put the
word "multiple".]

Thanks.
Paul

email: pa...@pharos.co.nz

Kent Tong

unread,
Jul 27, 1994, 6:07:57 PM7/27/94
to
In article <6694206.2...@kcbbs.gen.nz>, pa...@kcbbs.gen.nz (Paul Reddy) writes:
|> Hi
|> We have a client who is determined to have a selectable list
|> displayed using a drop down combo with check boxes. We currently
|> use a multiselect in the drop down - but he is determined to have
|> check boxes.
|>
|> Does such a beast exist? (We are using VB). ie is there a
|> combo into which you can have two columns, one of which is
|> a check box?

Try using a multiselect combo with owner-drawn style and drawing
the check box yourself (checked when selected, unchecked when
not selected).

--
Kent Tong (to...@archsci.arch.su.edu.au)
Team OS/2 new member
Key Center of Design Computing, Sydney University

Matt Arnold

unread,
Jul 28, 1994, 12:57:59 AM7/28/94
to
pa...@kcbbs.gen.nz (Paul Reddy) writes:

>Hi
>We have a client who is determined to have a selectable list
>displayed using a drop down combo with check boxes. We currently
>use a multiselect in the drop down - but he is determined to have
>check boxes.

>Does such a beast exist? (We are using VB). ie is there a
>combo into which you can have two columns, one of which is
>a check box?

No, but you can easily simlulate this by using an owner-drawn
comboboxx. Instead of just rendering the string for each item,
you draw the checkbox bitmap (in the right state of course)
followed by the item text. You can get the standard checkbox
bitmaps using LoadBitmap(). You can create an owner-drawn
combobox by creating it the the CBS_OWNERDRAW or CBS_OWNERDRAWFIXED
styles. To perform the "owner-drawing" you must process the
WM_MEASUREITEM, WM_DRAWITEM and possibly the WM_DELETEITEM messages.

For simplicity, I would say that you should toggle the state of
the check box when you get a CBN_DBLCLK message for a given
item.

Or, you could subclass the combobox's listbox (remember a combo
box is actually more than one window) and intercept WM_LBUTTONDOWN,
etc. to see if the user is clicking directly on a checkbox bitmap
(to do this, you could start by sending the listbox LB_GETTOPINDEX
and LB_GETITEMRECT messages to do your hit-detection).

The problem here (and you might want to tell this to your client)
is that by putting checkboxes in a list, you are mixing two types
of user input. When the use clicks on an item, do you select it
(the default, "expected" behavior), toggle the checkbox (you have
to have some way to do this) or both??

An alternate to doing what your client wants is to use a popup menu
with checked menu items. Windows users already know how to use
checked menu items.

Changing the expected behavior of Windows only increases the likelyhood
that your program will confuse your users. And the last thing you want
to do is make things harder for your users, right?

Matt

Paul B. Poh

unread,
Aug 5, 1994, 12:36:19 PM8/5/94
to

>>>>> "Kent" == Kent Tong <to...@cornea.su.edu.au> writes:

Kent> In article <6694206.2...@kcbbs.gen.nz>, pa...@kcbbs.gen.nz
Kent> (Paul Reddy) writes:
Kent> |> Hi
Kent> |> We have a client who is determined to have a selectable list
Kent> |> displayed using a drop down combo with check boxes. We currently
Kent> |> use a multiselect in the drop down - but he is determined to have
Kent> |> check boxes.
Kent> |>
Kent> |> Does such a beast exist? (We are using VB). ie is there a
Kent> |> combo into which you can have two columns, one of which is
Kent> |> a check box?
Kent>
Kent> Try using a multiselect combo with owner-drawn style and drawing
Kent> the check box yourself (checked when selected, unchecked when not
Kent> selected).

Sorry to break into this conversation, but how exactly do you get a
multiselect drop-down combo. I thought that there was no such thing. Or is
it some VB custom control.

--

-----------
Paul B. Poh (pp...@iddis.com)
Software Development
IDD Information Services

0 new messages