Board index » delphi » ListBox without a vertical scrollbar

ListBox without a vertical scrollbar

Hi,

Does anyone knows the exact code to hide the vertical scroll bar of a
ListBox ?

Thanks

 

Re:ListBox without a vertical scrollbar


Make it big enough, so that all items fit into view <g>
How will user know there are more items than viewed without scrollbar?
--
Robert
Quote
Erik De Laet wrote in message ...
>Hi,

>Does anyone knows the exact code to hide the vertical scroll bar of a
>ListBox ?

>Thanks

Re:ListBox without a vertical scrollbar


The Listbox does not need a scrollbar since it is following two other
listboxes (one to the left and one to the right) of it, which do include
listboxes.
The listbox in the middle will hold an indication whether the string to
the left is greater than the string to the right.
When scrolling to either the left or the right listboxes, the middle
should stay 'tuned'.
My question remains ;-)

Erik

In article <9nftq3.2j...@neosys.xrs.si>,
robert.qwe.ce...@neosys.xrs.qwe.si says...

Quote
> Make it big enough, so that all items fit into view <g>
> How will user know there are more items than viewed without scrollbar?
> --
> Robert

> Erik De Laet wrote in message ...
> >Hi,

> >Does anyone knows the exact code to hide the vertical scroll bar of a
> >ListBox ?

> >Thanks

--
Erik De Laet
E.De.L.Com bvba - www.edelcom.com

Re:ListBox without a vertical scrollbar


You'll have to subclass TListView with your own class by creating a new
unit/component.  Once you do, place this procedure in the private section of
the class:

procedure TNoScrollListView.WMNCCalcSize(var msg: TMessage);
var
   style: Integer;
begin
   style := getWindowLong(handle, GWL_STYLE);
   if(style and WS_HSCROLL) <> 0 then
      SetWindowLong(handle, GWL_STYLE, style and not WS_HSCROLL);
   if(style and WS_VSCROLL) <> 0 then
      SetWindowLong(handle, GWL_STYLE, style and not WS_VSCROLL);
   inherited;
end;

Thanks to Peter Below from TeamB who gave me this solution earlier.

Erik De Laet <erik.del...@skynet.be> wrote in message
news:MPG.16056b852154fe11989684@newsgroups.borland.com...

Quote
> Hi,

> Does anyone knows the exact code to hide the vertical scroll bar of a
> ListBox ?

> Thanks

Re:ListBox without a vertical scrollbar


No, your question was answered.
Either make the listbox big enough for all items to fit in view or put in it
as many items as fit in view.

--
Robert

Quote
Erik De Laet wrote in message ...
>The Listbox does not need a scrollbar since it is following two other
>listboxes (one to the left and one to the right) of it, which do include
>listboxes.
>The listbox in the middle will hold an indication whether the string to
>the left is greater than the string to the right.
>When scrolling to either the left or the right listboxes, the middle
>should stay 'tuned'.
>My question remains ;-)

Re:ListBox without a vertical scrollbar


Thanks, Phil.
This is indeed what I was looking for. Will try that out today.

Erik

In article <3b9ced15_1@dnews>, p...@spencertechnologies.com says...

Quote
> You'll have to subclass TListView with your own class by creating a new
> unit/component.  Once you do, place this procedure in the private section of
> the class:

> procedure TNoScrollListView.WMNCCalcSize(var msg: TMessage);
> var
>    style: Integer;
> begin
>    style := getWindowLong(handle, GWL_STYLE);
>    if(style and WS_HSCROLL) <> 0 then
>       SetWindowLong(handle, GWL_STYLE, style and not WS_HSCROLL);
>    if(style and WS_VSCROLL) <> 0 then
>       SetWindowLong(handle, GWL_STYLE, style and not WS_VSCROLL);
>    inherited;
> end;

> Thanks to Peter Below from TeamB who gave me this solution earlier.

> Erik De Laet <erik.del...@skynet.be> wrote in message
> news:MPG.16056b852154fe11989684@newsgroups.borland.com...
> > Hi,

> > Does anyone knows the exact code to hide the vertical scroll bar of a
> > ListBox ?

> > Thanks

--
Erik De Laet
E.De.L.Com bvba - www.edelcom.com

Other Threads