临时的解决方案,继承SkinChatRichTextBox,在派生类加上:
[C#] 纯文本查看 复制代码
#region 滚动条移动
public const int WM_HSCROLL = 276;
public const int WM_VSCROLL = 277;
public const int WM_SETCURSOR = 32;
public const int WM_MOUSEWHEEL = 522;
public const int WM_MOUSEMOVE = 512;
public const int WM_MOUSELEAVE = 675;
public const int WM_MOUSELAST = 521;
public const int WM_MOUSEHOVER = 673;
public const int WM_MOUSEFIRST = 512;
public const int WM_MOUSEACTIVATE = 33;
// Scroll Bar Constants
private const int SB_HORZ = 0;
private const int SB_VERT = 1;
private const int SB_CTL = 2;
private const int SB_BOTH = 3;
[DllImport("user32.dll")]
public static extern int ShowScrollBar(IntPtr hwnd, int wBar, int bShow);
protected override void WndProc(ref Message m)
{
if (m.Msg == WM_VSCROLL)
{
ShowScrollBar(this.Handle, SB_VERT, 0);
ShowScrollBar(this.Handle, SB_VERT, 1);
}else if(m.Msg== WM_HSCROLL)
{
ShowScrollBar(this.Handle, SB_HORZ, 0);
ShowScrollBar(this.Handle, SB_HORZ, 1);
}
base.WndProc(ref m);
}
#endregion
|