Exemplo n.º 1
0
        public void StartControlSkin()
        {
            CalcRect();
            AssignHandle(hsbBase.Handle);
            hsbBase.SizeChanged     += new EventHandler(hsbBase_SizeChanged);
            hsbBase.LocationChanged += new EventHandler(hsbBase_LocationChanged);
            hsbBase.VisibleChanged  += new EventHandler(hsbBase_VisibleChanged);

            //构造一个假的滚动条
            FakeScrollBar = new Control();
            hsbBase.Parent.Controls.Add(FakeScrollBar);
            FakeScrollBar.Location = hsbBase.Location;
            FakeScrollBar.Size     = hsbBase.Size;
            FakeScrollBar.Visible  = hsbBase.Visible;

            FakeScrollBar.Paint += new PaintEventHandler(FakeScrollBar_Paint);

            FakeScrollBar.BringToFront();
            hsbBase.SendToBack();
            mp = new MessagePortal(FakeScrollBar.Handle, hsbBase.Handle);
            mp.OpenPortal();
        }