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

"read-only" listbox?

0 views
Skip to first unread message

David Hoy

unread,
Jul 2, 1993, 3:58:49 PM7/2/93
to

Hello All,

Any ideas on what might be the best way to create a "read
only" listbox in a dialog box (i.e. scrolling is enabled but no items
can be selected)? Disabling the listbox is visually unacceptable as it
greys out the entries.

One avenue I've explored which might be in the right direction
is to use an edit window rather than a listbox. The tricky part (for
me at least) is only showing a vertical scroll bar when it's
necessary. I like the way a listbox handles it automagically. Any
advice on this topic, too, would also be appreciated.

Thanks In Advance,


--
Dave Hoy | | (513) 865-1871
Mead Data Central | The lottery is a tax on | Common Object Library
P.O. Box 933 | people who are bad at math. | hoy...@meaddata.com
Dayton, Ohio 45401 | | uunet!meaddata!hoyski

Tony Boggis

unread,
Jul 2, 1993, 5:47:19 PM7/2/93
to
In article <21241p$9...@meaddata.meaddata.com> hoy...@meaddata.com (David Hoy) writes:
>
>Hello All,
>
> Any ideas on what might be the best way to create a "read
>only" listbox in a dialog box (i.e. scrolling is enabled but no items
>can be selected)? Disabling the listbox is visually unacceptable as it
>greys out the entries.
>
> One avenue I've explored which might be in the right direction
>is to use an edit window rather than a listbox. The tricky part (for
>me at least) is only showing a vertical scroll bar when it's
>necessary. I like the way a listbox handles it automagically. Any
>advice on this topic, too, would also be appreciated.
>

Try subclassing the listbox and trapping WM_BUTTONDOWN messages and
also WM_CHAR (space, enter etc) this might work.

You could also try doing an owner-draw listbox and draw the text the
same way, regardless of the selection state indicated in the
WM_DRAWITEM message's structure.

Anyone else have any comments on these options ?

tonyB.

--
*************************************************************
* abo...@netcom.com * That's me here... *
* a...@walker.com * That's me at work... *
* a...@sactoh0.sac.ca.us * This was the first. *.
* 7025...@compuserve.com * this is the expensive one ! *
*************************************************************
* "I'm sorry Mr. Boggis, we have no rooms left" *
* "Well, if the President was coming, you'd have a room for *
* him, wouldn't you?" *
* "Well, yes sir." *
* "Well, he's not coming, so I'll have his room then!" *
*************************************************************

Robert Salesas

unread,
Jul 2, 1993, 9:31:15 PM7/2/93
to
It depends what you want to do. The easiest way is to use it "as is". Just
ignore any selections. If you really don't like the highlighting, then
you're going to have to make it and "owner-drawn" listbox.

Rob

--

\------------------------------------------------------------------------/
\ Robert Salesas | Internet: Robert_...@mindlink.bc.ca /
\ Eschalon Development Inc. | CIS: 76625,1320 Tel/Fax: 604-520-1543 /
\------------------------------------------------------------------------/

0 new messages