listbox scrolling

B

Bob Dankert

I have a custom listbox where the items are of a much larger height than a
standard listbox (each item sometimes can be half the height of the total
listbox). I am currently capturing all scroll messages in WndPrc and
sending my own scroll messages using the following method:

private void scrollMe(System.IntPtr dir)
{
System.Windows.Forms.Message ScrollMessage = new Message();
ScrollMessage.HWnd = Handle;
ScrollMessage.Msg = 0x0115;
ScrollMessage.WParam = dir;
this.DefWndProc( ref ScrollMessage );
}

The problem with my scrolling is that I it will scroll almost a page at a
time, because the listbox by default scrolls to the end of the current item.
Is there anyway to make the listbox so that it can scroll so the bottom of
the listbox is not necessarily the bottom of the item (ie, it cuts off part
of the item)? It would be nice if I could specify that each scroll
increment were a set number of pixels (each scroll, go 5 pixels).

I appreciate any help in this matter,

Bob Dankert
 
J

Jeffrey Tan[MSFT]

Hi Bob,

For this issue, I will spend some time on it to see if there is a way to
scroll only part of an item height.

Thanks for your understanding.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
B

Bob Dankert

Jeffrey,

Thanks a lot, I look forward to hearing of any possible solutions.

Bob Dankert
 
J

Jeffrey Tan[MSFT]

Hi Bob,

Thanks very much for your reply!

After doing some research and interal consulting, I found that the listbox
scrolling only supports item height granularity. It always wants to start
painting with the top of an item aligned to the top of the listbox. This is
by design.

For your issue, because you draw a much larger item height for ListBox, I
think you may also provide a larger ListBox to display the items, then the
scroll will not be strange.

Hope this makes sense to you.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
B

Bob Dankert

Thanks for checking into the issue Jeffrey, I was afraid that would be the
answer I would get. I will find other ways to work around the issue.

Thanks for the help!

Bob Dankert
 
J

Jeffrey Tan[MSFT]

Hi Bob,

Thanks very much for your reply!

Ok, if you need further help, please feel free to tell me, I will work with
you. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top