コード例 #1
0
        public PoisonDataGridHelper(PoisonScrollBar scrollbar, DataGridView grid, bool vertical)
        {
            _scrollbar             = scrollbar;
            _scrollbar.UseBarColor = true;
            _grid         = grid;
            _ishorizontal = !vertical;

            foreach (object item in _grid.Controls)
            {
                if (item.GetType() == typeof(VScrollBar))
                {
                    vScrollbar = (VScrollBar)item;
                }

                if (item.GetType() == typeof(HScrollBar))
                {
                    hScrollbar = (HScrollBar)item;
                }
            }

            _grid.RowsAdded         += new DataGridViewRowsAddedEventHandler(_grid_RowsAdded);
            _grid.UserDeletedRow    += new DataGridViewRowEventHandler(_grid_UserDeletedRow);
            _grid.Scroll            += new ScrollEventHandler(_grid_Scroll);
            _grid.Resize            += new EventHandler(_grid_Resize);
            _scrollbar.Scroll       += _scrollbar_Scroll;
            _scrollbar.ScrollbarSize = 21;

            UpdateScrollbar();
        }
コード例 #2
0
 public PoisonDataGridHelper(PoisonScrollBar scrollbar, DataGridView grid) : this(scrollbar, grid, true)
 {
 }