1

Topic: Question on CListCtrl

There is component IDC_LIST1 to which there corresponds a variable m_IDC_LIST1 type CListCtrl. Thus this component IDC_LIST1 is delivered in a datasheet view (). 20 lines are shown thus without scrolling only. There is a dynamic array (vector) vector myvect <string> (or vector myvect <char [80]>), 150 lines containing, say, (std:: string or char [80]). How to make so that at scrolling () it  IDC_LIST1 on a vertical 50 current lines would be displayed only? That is at me in it  50 first lines are allocated only, I scroll this  on a vertical downwards and when I get for 51st line at me contents  change - instead of lines with 1st on 50th at me in it  lines with 10th on 100th are displayed. And when at the further scrolling  on a vertical downwards I get for 101st line at me in  lines with 51st on 100th, and with 101st on 150th are displayed not. Similarly at a projacket  upwards - when I get for 100th line at me in  lines with 51st on 100th (thus bottom line are displayed there will be 100th line), instead of with 101st on 150th. And when I continue to scroll  upwards and I get for 50th line at me in  lines with 1st on 50th (thus are displayed 50th line there will be lower), instead of lines with 51st on 100th. That is that I could not place all together 150 lines from my dynamic array (vector), and show this dynamic array "in parts" - at first the first part till 50 lines, then the second part till 50 lines, then the third part till 50 lines. How it to make? And how to define at scrolling  IDC_LIST1, on what its line I am? What function is better for using thus - OnLvnBeginScrollList1 or OnLvnEndScrollList1?

2

Re: Question on CListCtrl

Hello, RussianFellow, you wrote: RF> There is component IDC_LIST1 to which there corresponds a variable m_IDC_LIST1 type CListCtrl. Thus this component IDC_LIST1 is delivered in a datasheet view (). 20 lines are shown thus without scrolling only. RF> there is a dynamic array (vector) vector myvect <string> (or vector myvect <char [80]>), 150 lines containing, say, (std:: string or char [80]). RF> How to make so that at scrolling () it  IDC_LIST1 on a vertical 50 current lines would be displayed only? That is at me in it  50 first lines are allocated only, I scroll this  on a vertical downwards and when I get for 51st line at me contents  change - instead of lines with 1st on 50th at me in it  lines with 10th on 100th are displayed. And when at the further scrolling  on a vertical downwards I get for 101st line at me in  lines with 51st on 100th, and with 101st on 150th are displayed not. RF> it is similar at a projacket  upwards - when I get for 100th line at me in  lines with 51st on 100th (thus bottom line are displayed there will be 100th line), instead of with 101st on 150th. And when I continue to scroll  upwards and I get for 50th line at me in  lines with 1st on 50th (thus are displayed 50th line there will be lower), instead of lines with 51st on 100th. RF> That is that I could not place all together 150 lines from my dynamic array (vector) and show this dynamic array "in parts" - at first the first part till 50 lines, then the second part till 50 lines, then the third part till 50 lines. RF> as it to make? Virtual List Controls RF> and how to define at scrolling  IDC_LIST1, on what its line I am? What function is better for using thus - OnLvnBeginScrollList1 or OnLvnEndScrollList1? "On what its line" who is? selection? An index upper (or lower) lines?

3

Re: Question on CListCtrl

Hello, VladFein, you wrote: RF>> And how to define at scrolling  IDC_LIST1, on what its line I am? What function is better for using thus - OnLvnBeginScrollList1 or OnLvnEndScrollList1? VF> "on what its line" who is? selection? An index upper (or lower) lines? A bottom line index.

4

Re: Question on CListCtrl

Hello, RussianFellow, you wrote: RF> Hello, VladFein, you wrote: RF>>> And how to define at scrolling  IDC_LIST1, on what its line I am? What function is better for using thus - OnLvnBeginScrollList1 or OnLvnEndScrollList1? VF>> "on what its line" who is? selection? An index upper (or lower) lines? RF> a bottom line index. Also me the top line index (interests also at  upwards).

5

Re: Question on CListCtrl

Hello, RussianFellow, you wrote: RF>> a bottom line Index. RF> also me the top line index (interests also at  upwards). CListCtrl:: GetTopIndex CListCtrl:: GetCountPerPage

6

Re: Question on CListCtrl

Hello, VladFein, you wrote: VF> CListCtrl:: GetTopIndex VF> CListCtrl:: GetCountPerPage it is clear. And still a question: whether it is possible to define (for example, as CListCtrl:: OnVScroll) in what direction I carry out scrolling - downwards or upwards, or was not present such possibility?

7

Re: Question on CListCtrl

Hello, RussianFellow, you wrote: VF>> CListCtrl:: GetTopIndex VF>> CListCtrl:: GetCountPerPage RF> it is clear. And still a question: whether it is possible to define (for example, as CListCtrl:: OnVScroll) in what direction I carry out scrolling - downwards or upwards, or was not present such possibility? It is possible to compare to the previous (remembered) value TopIndex.