public UserManagerForm(ExtendedForm parentForm) : base(parentForm) { Load += frmUserManager_Load; InitializeComponent(); StyleFunctions.SetGridStyle(UserGrid, GridTheme); Show(); }
private void GetGridStyles() { //Set default styles for all grid forms. Colors.DefaultGridBackColor = ResultGrid.DefaultCellStyle.BackColor; ResultGrid.DefaultCellStyle.SelectionBackColor = Colors.OrangeSelectColor; this.GridTheme = new GridTheme(Colors.OrangeHighlightColor, Colors.OrangeSelectColor, Colors.OrangeSelectAltColor, ResultGrid.DefaultCellStyle.BackColor); StyleFunctions.DefaultGridStyles = new DataGridViewCellStyle(ResultGrid.DefaultCellStyle); StyleFunctions.AlternatingRowDefaultStyles = new DataGridViewCellStyle(ResultGrid.AlternatingRowsDefaultCellStyle); StyleFunctions.SetGridStyle(ResultGrid, GridTheme); }
private DataGridView GetNewGrid(string name, string label, DoubleClickAction type) { DataGridView newGrid = new DataGridView(); var gridLabel = label; newGrid.Name = name; newGrid.Dock = DockStyle.Fill; newGrid.RowHeadersVisible = false; newGrid.EditMode = DataGridViewEditMode.EditProgrammatically; newGrid.AllowUserToResizeRows = false; newGrid.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing; newGrid.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None; newGrid.AllowUserToAddRows = false; newGrid.AllowUserToDeleteRows = false; newGrid.Padding = new Padding(0, 0, 0, 10); newGrid.ContextMenuStrip = PopUpMenu; StyleFunctions.SetGridStyle(newGrid, ParentForm.GridTheme); newGrid.CellLeave += GridLeaveCell; newGrid.CellEnter += GridEnterCell; // Set double-click event according to specified action. switch (type) { case DoubleClickAction.ViewDevice: gridLabel += " - [Double-Click to view]"; newGrid.CellDoubleClick += DoubleClickDevice; break; case DoubleClickAction.SelectValue: newGrid.CellDoubleClick += DoubleClickSelect; break; case DoubleClickAction.ViewOnly: // Don't subscribe double-click event. break; } newGrid.Tag = gridLabel; newGrid.DoubleBuffered(true); return(newGrid); }
private void InitForm() { try { this.Icon = Properties.Resources.sibi_icon; SibiResultGrid.DoubleBuffered(true); this.GridTheme = new GridTheme(Colors.HighlightBlue, Colors.SibiSelectColor, Colors.SibiSelectAltColor, SibiResultGrid.DefaultCellStyle.BackColor); StyleFunctions.SetGridStyle(SibiResultGrid, this.GridTheme); ToolStrip1.BackColor = Colors.SibiToolBarColor; windowList.InsertWindowList(ToolStrip1); SetDisplayYears(); ShowAll("All"); GetMunisStatuses(); this.Show(); this.Activate(); } catch (Exception ex) { ErrorHandling.ErrHandle(ex, System.Reflection.MethodBase.GetCurrentMethod()); this.Dispose(); } }
private void SetTracking(bool isTrackable, bool isCheckedOut) { if (isTrackable) { if (!TabControl1.TabPages.Contains(TrackingTab)) { TabControl1.TabPages.Insert(1, TrackingTab); } ExpandSplitter(true); TrackingBox.Visible = true; TrackingToolStrip.Visible = isTrackable; CheckOutTool.Visible = !isCheckedOut; CheckInTool.Visible = isCheckedOut; } else { TrackingToolStrip.Visible = isTrackable; TabControl1.TabPages.Remove(TrackingTab); TrackingBox.Visible = false; ExpandSplitter(); } StyleFunctions.SetGridStyle(DataGridHistory, GridTheme); StyleFunctions.SetGridStyle(TrackingGrid, GridTheme); }