MarkupListBox |
Post Reply |
Author | |
jimmy
Senior Member Joined: 11 November 2003 Location: Austria Status: Offline Points: 515 |
Post Options
Thanks(0)
Posted: 29 March 2010 at 6:30am |
Hello,
i use the MarkupListBox from MarkupSample. But is you scroll with mouse wheel it's look like horror. see markup sample (9 entrys). Any solution for this ? Jimmy |
|
jimmy
Senior Member Joined: 11 November 2003 Location: Austria Status: Offline Points: 515 |
Post Options
Thanks(0)
|
Hello,
found a solution. Handle WM_MOUSEWHEEL my self. void CMarkupListBox::OnHandleMouseWheel(WPARAM wParam, LPARAM lParam) { short zDelta = GET_WHEEL_DELTA_WPARAM(wParam); // Don't do anything if the vertical scrollbar is not enabled. int scrollMin = 0, scrollMax = 0; GetScrollRange(SB_VERT, &scrollMin, &scrollMax); if ( scrollMin == scrollMax ) return; // Compute the number of scrolling increments requested. int numScrollIncrements = abs(zDelta) / WHEEL_DELTA; // Each scrolling increment corresponds to a certain number of // scroll lines (one scroll line is like a SB_LINEUP or SB_LINEDOWN). // We need to query the system parameters for this value. int numScrollLinesPerIncrement = 0; ::SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &numScrollLinesPerIncrement, 0); // Check if a page scroll was requested. if ( numScrollLinesPerIncrement == WHEEL_PAGESCROLL ) { SendMessage(WM_VSCROLL, zDelta > 0 ? SB_PAGEUP : SB_PAGEDOWN, 0); return; } // Compute total number of lines to scroll. int numScrollLines = numScrollIncrements * numScrollLinesPerIncrement; // Adjust numScrollLines to slow down the scrolling a bit more. numScrollLines = max(numScrollLines/3, 1); // Do the scrolling. for(int i = 0; i < numScrollLines; ++i) SendMessage(WM_VSCROLL, zDelta > 0 ? SB_LINEUP : SB_LINEDOWN, 0); } Jimmy |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |