15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


List View Control Scrolling

Harry Hahne -- hahne@epas.utoronto.ca
Wednesday, August 07, 1996

Environment: Visual C++ 4.1, Windows 95

I am trying to create a virtual list view control which uses 
the report view to display a large number of records from a 
database, one record per line. My list view control is derived 
from CListCtrl. 

In order to manage the virtual list view, I am filling the 
control with only one screen-full of items at a time.  I want 
to disable vertical scrolling so I can use my own scroll bar 
which controls the virtual list.  But I still need horizontal 
scrolling if the window is too narrow to display the entire 
width of the list view control.

How can I horizontally scroll the contents of a list view 
control in report view?  I tried CListView::Scroll() but it 
does not seem to do anything.  Is there a way to get horizontal 
scrolling but not vertical scrolling?

Alternatively, is there an example of a virtual list view 
control somewhere (I know about VList example).

Harry Hahne
hahne@chass.utoronto.ca





Gene Sewell -- genes@fast.net
Monday, August 12, 1996

Hi Harry,

>In order to manage the virtual list view, I am filling the 
>control with only one screen-full of items at a time.  I want 
>to disable vertical scrolling so I can use my own scroll bar 
>which controls the virtual list.  But I still need horizontal 
>scrolling if the window is too narrow to display the entire 
>width of the list view control.

>How can I horizontally scroll the contents of a list view 
>control in report view?  I tried CListView::Scroll() but it 
>does not seem to do anything.  Is there a way to get horizontal 
>scrolling but not vertical scrolling?

I also do a virtual list control.  I would suggest that the easiest way to
go is to add all the column data you need.  The widget will support the
horizontal scrolling on it's own that way.  For vertical scrolling, use the
virtual approach.  Perhaps you have a huge number of columns, in which case
you might choose the virtual approach to horizontal scrolling, but for a
reasonalble number, I would try to keep it simple, myself.

Gene
----
The public have an insatiable curiosity to know everything.  Except what 
is worth knowing.  Journalism, conscious of this, and having 
tradesman-like habits, supplies their demands. -Oscar Wilde





| Вернуться в корень Архива |