Esempio n. 1
0
        public ScrollableControl()
        {
            hscrollbar = new HorizontalScrollBar {
                Visible = false
            };

            hscrollbar.ValueChanged += HandleScroll;
            hscrollbar.Scroll       += (o, e) => OnScroll(e);

            vscrollbar = new VerticalScrollBar {
                Visible = false
            };

            vscrollbar.ValueChanged += HandleScroll;
            vscrollbar.Scroll       += (o, e) => OnScroll(e);

            sizegrip = new SizeGrip {
                Visible = false
            };

            Controls.AddImplicitControlRange(sizegrip, hscrollbar, vscrollbar);

            SizeChanged    += (o, e) => Recalculate(true);
            VisibleChanged += (o, e) => Recalculate(true);
        }