Chris R

Thank for the insight on scrolling a listbox.
Here is a class derived from System.Windows.Forms.ListBox
with one Method HScroll that maybe others will want to use.

Odis Wooten

class myListbox : System.Windows.Forms.ListBox
{
   public void HScroll(int direction)
   {
      //Set  direction to 0 to scroll left 1 char
      //Set  direction to 1 to scroll right 1 char
      //Set  direction to 2 to scroll 1 page left
      //Set  direction to 3 to scroll 1 page right
      System.Windows.Forms.Message hScrollMessage = new Message();

      hScrollMessage.HWnd   = Handle;
      hScrollMessage.Msg    = 0x0114;  // // #define WM_HSCROLL 0x0114
      hScrollMessage.WParam = (IntPtr)direction;
      this.DefWndProc( ref hScrollMessage );
   }
}

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to