示例#1
0
        public void StartControlSkin()
        {
            CalcRect();
            AssignHandle(vsbBase.Handle);

            vsbBase.SizeChanged     += new EventHandler(vsbBase_SizeChanged);
            vsbBase.LocationChanged += new EventHandler(vsbBase_LocationChanged);
            vsbBase.VisibleChanged  += new EventHandler(vsbBase_VisibleChanged);

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

            FakeScrollBar.Paint += new PaintEventHandler(FakeScrollBar_Paint);

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