作者: luckyzhang
查看: 1206|回复: 4
打印 上一主题 下一主题

skinChatRichTextBox 关于滚动条问题

[复制链接]
楼主
azkiki 发表于 2016-3-24 11:05:05 | 显示全部楼层
临时的解决方案,继承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
您需要登录后才可以回帖 登录 | 加入CSkin博客

本版积分规则

QQ|申请友链|小黑屋|手机版|Archiver|CSkin ( 粤ICP备13070794号

Powered by Discuz! X3.2  © 2001-2013 Comsenz Inc.  Designed by ARTERY.cn
GMT+8, 2024-5-8 20:43, Processed in 0.540494 second(s), 27 queries , Gzip On.

快速回复 返回顶部 返回列表