/// <summary> /// Initializes a new instance of the <see cref="UserSelectionEventArgs"/> class. /// </summary> /// <param name="selection">The selection.</param> public UserSelectionEventArgs(Selection selection) { this.selection = selection; }
/// <summary> /// Grid Constructor /// </summary> public GridVirtual() { // default double buffer SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.ResizeRedraw, true); SetStyle(ControlStyles.DoubleBuffer, true); topPanel = new GridSubPanel(this, true); topPanel.TabStop = false; leftPanel = new GridSubPanel(this, true); leftPanel.TabStop = false; topLeftPanel = new GridSubPanel(this, true); topLeftPanel.TabStop = false; scrollablePanel = new GridSubPanel(this, true); scrollablePanel.TabStop = false; hiddenFocusPanel = new GridSubPanel(this, false); hiddenFocusPanel.TabStop = true; //questo è l'unico pannello a poter ricevere il tab rows = new RowInfo.RowInfoCollection(this); rows.RowHeightChanged += new RowInfoEventHandler(rows_RowHeightChanged); rows.RowsAdded += new IndexRangeEventHandler(rows_RowsAdded); columns = new ColumnInfo.ColumnInfoCollection(this); columns.ColumnWidthChanged += new ColumnInfoEventHandler(columns_ColumnWidthChanged); columns.ColumnsAdded += new IndexRangeEventHandler(columns_ColumnsAdded); rows.RowsRemoved += new IndexRangeEventHandler(rows_RowsRemoved); columns.ColumnsRemoved += new IndexRangeEventHandler(columns_ColumnsRemoved); SuspendLayoutGrid(); Controls.Add(hiddenFocusPanel); hiddenFocusPanel.Location = new Point(0, 0); hiddenFocusPanel.Size = new Size(2, 2); topLeftPanel.Location = new Point(0, 0); Controls.Add(scrollablePanel); Controls.Add(topLeftPanel); Controls.Add(topPanel); Controls.Add(leftPanel); // hide this panel hiddenFocusPanel.SendToBack(); hiddenFocusPanel.TabIndex = 0; Size = new System.Drawing.Size(200, 200); selection = new Selection(this); ContextMenuStyle = 0; ResumeLayoutGrid(); }