Source/Controls/ScrollBarImplementation.cs

(开头部分) 24KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Windows.Forms;
using System.Text;
using DevComponents.DotNetBar.ScrollBar;
using System.Drawing;
using DevComponents.DotNetBar.Rendering;
using System.Runtime.InteropServices;

namespace DevComponents.DotNetBar.Controls
{
    internal class ScrollBarImplementation: IDisposable
    {
        #region Private Variables
        private System.Windows.Forms.ScrollBar m_ParentScrollBar = null;
        private ScrollBarCore m_ScrollBarCore = null;
        private bool m_FirstPaint = true;
        private int m_MouseDownTrackOffset = 0;
        private Timer m_PaintTimer = null;
        private bool m_IsVScrollBar = false;
        private IScrollBarExtender m_ParentScrollBarWndProc = null;
        private bool m_UseLockWindowUpdate = false;
        #endregion

        #region Constructor
        public ScrollBarImplementation(System.Windows.Forms.ScrollBar sb)
        {
            m_ParentScrollBar = sb;
            m_ParentScrollBarWndProc = (IScrollBarExtender)m_ParentScrollBar;
            m_IsVScrollBar = m_ParentScrollBar is VScrollBar;

            m_PaintTimer = new Timer();
            m_PaintTimer.Interval = 50;
            m_PaintTimer.Tick += new EventHandler(PaintTimerTick);

            m_ScrollBarCore = new ScrollBarCore(m_ParentScrollBar, true);
            //m_ScrollBarCore.IsAppScrollBarStyle = false;
            if (m_ParentScrollBar is HScrollBar)
                m_ScrollBarCore.Orientation = eOrientation.Horizontal;
            else
                m_ScrollBarCore.Orientation = eOrientation.Vertical;
            m_ScrollBarCore.Minimum = m_ParentScrollBar.Minimum;
            m_ScrollBarCore.Maximum = m_ParentScrollBar.Maximum;
            m_ScrollBarCore.Value = m_ParentScrollBar.Value;
        }
        #endregion

        #region Internal Implementation
        internal void OnHandleCreated()
        {
            Themes.SetWindowTheme(m_ParentScrollBar.Handle, "", "");
            UpdateScrollValues();
        }

        internal bool WndProc(ref Message m)
        {
            if (m.Msg == (int)WinApi.WindowsMessages.SBM_SETSCROLLINFO || m.Msg == 0x2114 || m.Msg == 0x2115 || m.Msg == (int)WinApi.WindowsMessages.WM_MOUSEMOVE)
            {
                CallBaseWndProc(ref m);
                SendDelayPaintMessage();
                return false;
后面还有 554 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。