s_rookie

Hello,

for Windows Mobile 5.0/C#/netcf 2.0+

  1. Can I use a button to scroll the list insted of using the scrollbar.
  2. Can I hide the Scrollbar

I.e i would like to use two regular buttons below the list so that one button corresponds to list UP and the other DOWN.

How do i program the event handling

Pls send me a link of any online code/sample/discussion/article.

Thanks,

Rookie



Re: .NET Compact Framework ListBox_ScrollBar_Scroll using Button

ChunSheng Tang - MSFT

Hi, Rookie

Though I haven't found any property which directly hides the scrollbar, you can tailor the data source of the listbox so that it contains exactly what should be shown.

What I mean is that if the listbox can show 4 items at most, then let the data source have a maximum length of 4 and take control of its content according to the current position and the button clicked.

You may consider wrapping these into a user control.

Hope this helps

Warren Tang






Re: .NET Compact Framework ListBox_ScrollBar_Scroll using Button

ChunSheng Tang - MSFT

Hi, Rookie

There are also other ways. Maybe you would like to have a try.
If you want to
1. Use up/down button to scroll the list instead of using the scrollbar.
2. Hide the scrollbar.

You can use WIN32 APIs by Platform Invoke to achieve these goals:
1. To let the scroll bar scroll, use SendMessage to send a WM_VSCROLL message to the scroll bar.

For how to use SendMessage, see this link: http://msdn2.microsoft.com/en-us/library/ms644950.aspx
2. To hide the scroll bar, use ShowScrollBar function.

Here is how to use it: http://msdn2.microsoft.com/en-us/library/ms651296.aspx

Regards
Tang