Click here to Skip to main content
15,917,005 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Learning Visual C++ Pin
l a u r e n24-Mar-01 3:12
l a u r e n24-Mar-01 3:12 
GeneralRe: Learning Visual C++ Pin
Hadi Rezaee24-Mar-01 20:45
Hadi Rezaee24-Mar-01 20:45 
GeneralRe: Learning Visual C++ Pin
24-Mar-01 9:43
suss24-Mar-01 9:43 
GeneralTAB Key ... Pin
Hadi Rezaee23-Mar-01 23:50
Hadi Rezaee23-Mar-01 23:50 
QuestionHow do I create a flat listbox ? Pin
jeffreyren23-Mar-01 23:19
jeffreyren23-Mar-01 23:19 
GeneralMFC FTP Program: Help me please!! Pin
Ashman23-Mar-01 16:08
Ashman23-Mar-01 16:08 
GeneralForbidden flopy access ?! Pin
23-Mar-01 11:23
suss23-Mar-01 11:23 
GeneralCListBox and Scrollbar... Pin
Manfred Ramosch23-Mar-01 6:17
Manfred Ramosch23-Mar-01 6:17 
Does anybody know how to retrieve a WIN-message that indicates the scrollbar of
a Listbox having been scrolled up or down?

I have a modeless dialog with 6 listboxes (side by side) that get the V-Scrollbar
automatically when there are more Items to display than the LBs can show at once.
All lists do always have the same lenght due to the behaviour of my data.
What I want is to keep the LBs synchron - I mean that the TOPINDEX is the same
in all my boxes. Even when I move the scrollbar I wanna keep them in sync.

That works fine with the LBN_SELCHANGE for every box:

void CMyClass::OnSelchangeList01()
{
int iResult;

iResult = m_List01.GetCurSel();
m_List01.SetCurSel(iResult);
m_List02.SetCurSel(iResult);
m_List03.SetCurSel(iResult);
m_List04.SetCurSel(iResult);
m_List05.SetCurSel(iResult);
m_List06.SetCurSel(iResult);

iResult = m_List01.GetTopIndex();
m_List01.SetTopIndex();
m_List02.SetTopIndex();
m_List03.SetTopIndex();
m_List04.SetTopIndex();
m_List05.SetTopIndex();
m_List06.SetTopIndex();

}

The same I do for

OnSelchangeList02();
OnSelchangeList03();
OnSelchangeList04();
OnSelchangeList05();
OnSelchangeList06();

I can select whatever I want in whatever LB - with the mouse or the arrow-keys. The TopIndex
of every LB is the same and the selected items (highlighted) appear side by side.
So far so good -

ONLY after moving the vertical scrollbar the LBs are out of sync because I cannot get any
message of the scrollbar showing me that the visual state of the LB has changed and though
giving me the possibility to use the SetTopIndex()-function like above in the LBN_SELCHANGE
message handler of my LBs...

I tried it with CWnd::OnVScroll() but I couldn't find a way to retrieve a notification
from my Listbox-scrollbars out of this function...
All those nice SB_BOTTOM, SB_TOP, SB_THUMBTRACK - and I cannot access them......


So any Ideas out there...?


Manfred



---

Programming is knowing...
GeneralRe: CListBox and Scrollbar... Pin
Daniel Ferguson23-Mar-01 10:24
Daniel Ferguson23-Mar-01 10:24 
GeneralRe: CListBox and Scrollbar... Pin
l a u r e n23-Mar-01 21:49
l a u r e n23-Mar-01 21:49 
GeneralRe: CListBox and Scrollbar... Pin
Manfred Ramosch23-Mar-01 22:10
Manfred Ramosch23-Mar-01 22:10 
GeneralRe: CListBox and Scrollbar... Pin
l a u r e n24-Mar-01 3:09
l a u r e n24-Mar-01 3:09 
GeneralRe: CListBox and Scrollbar... Pin
3-Jul-01 5:35
suss3-Jul-01 5:35 
Generalwin95 exe's jump to win2000 - (Painful) Pin
Gerry23-Mar-01 5:40
Gerry23-Mar-01 5:40 
GeneralRe: win95 exe's jump to win2000 - (Painful) Pin
Kannan Kalyanaraman23-Mar-01 18:55
Kannan Kalyanaraman23-Mar-01 18:55 
GeneralRe: win95 exe's jump to win2000 - (Painful) Pin
l a u r e n23-Mar-01 21:57
l a u r e n23-Mar-01 21:57 
GeneralRe: win95 exe's jump to win2000 - (Painful) Pin
Erik Funkenbusch23-Mar-01 21:56
Erik Funkenbusch23-Mar-01 21:56 
GeneralGetting the original URL of a Temp. Internet File Pin
23-Mar-01 5:11
suss23-Mar-01 5:11 
GeneralAfxBeginThread and EndThread Pin
Vickie23-Mar-01 4:25
Vickie23-Mar-01 4:25 
GeneralRe: AfxBeginThread and EndThread Pin
Michael Dunn23-Mar-01 15:45
sitebuilderMichael Dunn23-Mar-01 15:45 
GeneralURGENT: Convert CHAR dimension into BSTR Pin
23-Mar-01 3:58
suss23-Mar-01 3:58 
GeneralRe: URGENT: Convert CHAR dimension into BSTR Pin
Gerry23-Mar-01 5:57
Gerry23-Mar-01 5:57 
GeneralRe: URGENT: Convert CHAR dimension into BSTR Pin
23-Mar-01 9:21
suss23-Mar-01 9:21 
GeneralRe: URGENT: Convert CHAR dimension into BSTR Pin
25-Mar-01 20:36
suss25-Mar-01 20:36 
Generalthe ATL way Pin
23-Mar-01 9:59
suss23-Mar-01 9:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.