two methods:1.
Class Win32
{
[DllImport("User32.Dll")]
public static extern bool SendMessage(IntPtr hWnd,int Msg,int wParam,int lParam);
public const int WM_VSCROLL = 0x0115;
public const int SB_LINEDOWN = 1;
}Win32.SendMessage(listBox1.Handle,Win32.WM_VSCROLL,Win32.SB_LINEDOWN,0);2.
class myListbox : System.Windows.Forms.ListBox
{
public void HScroll(System.IntPtr 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 = direction;
this.DefWndProc( ref hScrollMessage );
}
}
Class Win32
{
[DllImport("User32.Dll")]
public static extern bool SendMessage(IntPtr hWnd,int Msg,int wParam,int lParam);
public const int WM_VSCROLL = 0x0115;
public const int SB_LINEDOWN = 1;
}Win32.SendMessage(listBox1.Handle,Win32.WM_VSCROLL,Win32.SB_LINEDOWN,0);2.
class myListbox : System.Windows.Forms.ListBox
{
public void HScroll(System.IntPtr 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 = direction;
this.DefWndProc( ref hScrollMessage );
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货