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

skinChatRichTextBox 关于滚动条问题

[复制链接]
跳转到指定楼层
楼主
luckyzhang 发表于 2015-12-29 16:11:34 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
查看: 1200|回复: 4
当skinChatRichTextBox出现滚动条的时候,鼠标拖动滚动条时,滚动条不能随鼠标一起移动,等放开鼠标后,滚动条踩移到对应的位置(skinChatRichTextBox内容是会跟鼠标一起移动的,是正常的),需要怎么设置skinChatRichTextBox,才能使滚动条随鼠标一起移动。
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 转播转播
回复 论坛版权

使用道具 举报

沙发
乔克斯 发表于 2015-12-29 16:29:43 | 只看该作者
这个BUG还没有解决。原因未知。。。
板凳
 楼主| luckyzhang 发表于 2015-12-29 17:56:30 | 只看该作者
怎么办   我要哭了
地板
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
5#
乔克斯 发表于 2016-3-24 11:56:32 | 只看该作者
azkiki 发表于 2016-3-24 11:05
临时的解决方案,继承SkinChatRichTextBox,在派生类加上:
[mw_shl_code=csharp,true]
#region 滚动条移动 ...

ok。感觉提供解决方案。新版已加上这段代码。
您需要登录后才可以回帖 登录 | 加入CSkin博客

本版积分规则

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

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

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