Question related to List box control.
-
Hi all. How can I get the pointer/handle to the horizontal and vertical scroll bars from list box? I tried it using… CListBox *pList = (CListBox *) GetDlgItem(IDC_LIST); if( NULL == pList->GetSafeHwnd() ) return; CScrollBar* pVertScroll = pList->GetScrollBarCtrl(SB_VERT ) ; But it is returning NULL. Also how I can trap the events like WM_MOUSEMOVE over scroll bar arrows? Thanks
Sameer Thakur
-
Hi all. How can I get the pointer/handle to the horizontal and vertical scroll bars from list box? I tried it using… CListBox *pList = (CListBox *) GetDlgItem(IDC_LIST); if( NULL == pList->GetSafeHwnd() ) return; CScrollBar* pVertScroll = pList->GetScrollBarCtrl(SB_VERT ) ; But it is returning NULL. Also how I can trap the events like WM_MOUSEMOVE over scroll bar arrows? Thanks
Sameer Thakur
Sameer_Thakur wrote:
CScrollBar* pVertScroll = pList->GetScrollBarCtrl(SB_VERT ) ; But it is returning NULL.
Did you see MSDN? From the MSDN This member function does not operate on scroll bars created when the WS_HSCROLL or WS_VSCROLL bits are set during the creation of a window
WhiteSky
-
Sameer_Thakur wrote:
CScrollBar* pVertScroll = pList->GetScrollBarCtrl(SB_VERT ) ; But it is returning NULL.
Did you see MSDN? From the MSDN This member function does not operate on scroll bars created when the WS_HSCROLL or WS_VSCROLL bits are set during the creation of a window
WhiteSky
Hi. Yes I saw that point mentioned in MSDN.. Thats why I asked for the method to get handle to the Scroll bars of Listbox. Is there any way to get it? Thanks -- modified at 4:47 Saturday 3rd March, 2007
Sameer Thakur
-
Hi. Yes I saw that point mentioned in MSDN.. Thats why I asked for the method to get handle to the Scroll bars of Listbox. Is there any way to get it? Thanks -- modified at 4:47 Saturday 3rd March, 2007
Sameer Thakur
Can you say what do you need,excatly?
WhiteSky
-
Can you say what do you need,excatly?
WhiteSky
Sure. In my application I have added a list box on a dialog box. This list contain so many numbers of string elements that user has to scroll too much to see all the contents. I want to minimize the scrolling efforts of user and I want to provide auto scrolling to the list box. The elements of the list box should get scroll automatically when user movies the mouse pointer over scroll bar arrows of the list box. For that I want to … 1. Get the pointer or handle to the Scroll bars of list control. 2. Trap the event when mouse is moved over the scroll bar arrows and kept there for some predefined time say 2 sec. 3. Scroll down or up the list with some specified speed. How I can proceed to achieve these sub tasks? Thanks
Sameer Thakur
-
Hi all. How can I get the pointer/handle to the horizontal and vertical scroll bars from list box? I tried it using… CListBox *pList = (CListBox *) GetDlgItem(IDC_LIST); if( NULL == pList->GetSafeHwnd() ) return; CScrollBar* pVertScroll = pList->GetScrollBarCtrl(SB_VERT ) ; But it is returning NULL. Also how I can trap the events like WM_MOUSEMOVE over scroll bar arrows? Thanks
Sameer Thakur
Sameer_Thakur wrote:
Also how I can trap the events like WM_MOUSEMOVE over scroll bar arrows?
Look for
CWnd::OnNcHitTest
.Prasad Notifier using ATL | Operator new[],delete[][^]
-
Sure. In my application I have added a list box on a dialog box. This list contain so many numbers of string elements that user has to scroll too much to see all the contents. I want to minimize the scrolling efforts of user and I want to provide auto scrolling to the list box. The elements of the list box should get scroll automatically when user movies the mouse pointer over scroll bar arrows of the list box. For that I want to … 1. Get the pointer or handle to the Scroll bars of list control. 2. Trap the event when mouse is moved over the scroll bar arrows and kept there for some predefined time say 2 sec. 3. Scroll down or up the list with some specified speed. How I can proceed to achieve these sub tasks? Thanks
Sameer Thakur
I have a suggestion for you disable VERT and HORZ of list and insert two static control for list and when use want to use of scrollbar use of static ontrol,but you can desgin apparent of these static like scrollbar and another my suggestion is better you use of listctrl instead listbox ;)
WhiteSky