private void kbtnGetColourInformation_Click(object sender, EventArgs e) { ColourInformation colourInformation = new ColourInformation(); colourInformation.Show(); }
// set the panel colours private void SetPanelColours() { // set colours from user preferences if (SetColourInformation != null) { if (!FColourInfoSetup) { FColourInfo = SetColourInformation(); FColourInfoSetup = true; } } else { FColourInfo.FilterColour = System.Drawing.Color.LightBlue; FColourInfo.FindColour = System.Drawing.Color.BurlyWood; } this.FFilterColour = FColourInfo.FilterColour; this.FFindColour = FColourInfo.FindColour; // panels have a gradient colour so an end colour must be defined int FilterRed = 0; int FilterGreen = 0; int FilterBlue = 0; if (FFilterColour.R >= 30) { FilterRed = FFilterColour.R - 30; } if (FFilterColour.G >= 30) { FilterGreen = FFilterColour.G - 30; } if (FFilterColour.B >= 30) { FilterBlue = FFilterColour.B - 30; } int FindRed = 0; int FindGreen = 0; int FindBlue = 0; if (FFindColour.R >= 30) { FindRed = FFindColour.R - 30; } if (FFindColour.G >= 30) { FindGreen = FFindColour.G - 30; } if (FFindColour.B >= 30) { FindBlue = FFindColour.B - 30; } System.Drawing.Color FilterGradientEndColor = Color.FromArgb(FilterRed, FilterGreen, FilterBlue); System.Drawing.Color FindGradientEndColor = Color.FromArgb(FindRed, FindGreen, FindBlue); pnlFilterControls.GradientStartColor = FFilterColour; pnlFilterControls.GradientEndColor = FilterGradientEndColor; if (FPnlFindControls != null) { FPnlFindControls.GradientStartColor = FFindColour; FPnlFindControls.GradientEndColor = FindGradientEndColor; } }
public static void GetColourInformation() { ColourInformation colourInformation = new ColourInformation(); colourInformation.Show(); }
/// <summary> /// This procedure sets the default properties. /// /// </summary> /// <returns>void</returns> private void Set_DefaultProperties() { // Default size this.Height = 100; this.Width = 400; if (SetColourInformation != null) { if (!FColourInfoSetup) { FColourInfo = SetColourInformation(); FColourInfoSetup = true; } } else { FColourInfo.BackColour = System.Drawing.Color.White; FColourInfo.CellBackgroundColour = System.Drawing.Color.White; FColourInfo.AlternatingBackgroundColour = System.Drawing.Color.FromArgb(230, 230, 230); FColourInfo.SelectionColour = Color.FromArgb(150, Color.FromKnownColor(KnownColor.Highlight)); FColourInfo.GridLinesColour = System.Drawing.SystemColors.ControlDark; } // Default look this.BackColor = FColourInfo.BackColour; this.CellBackgroundColour = FColourInfo.CellBackgroundColour; this.AlternatingBackgroundColour = FColourInfo.AlternatingBackgroundColour; this.GridLinesColour = FColourInfo.GridLinesColour; this.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.AutoStretchColumnsToFitWidth = true; this.MinimumHeight = 19; ((SelectionBase) this.Selection).Border = new DevAge.Drawing.RectangleBorder(); ((SelectionBase) this.Selection).BackColor = FColourInfo.SelectionColour; ((SelectionBase) this.Selection).FocusBackColor = ((SelectionBase) this.Selection).BackColor; // Default behaviour this.TabStop = true; this.SpecialKeys = SourceGrid.GridSpecialKeys.Default ^ SourceGrid.GridSpecialKeys.Tab; this.DeleteQuestionMessage = "You have chosen to delete this record." + Environment.NewLine + Environment.NewLine + "Do you really want to delete it?"; this.FixedRows = 1; this.SortableHeaders = true; this.KeepRowSelectedAfterSort = true; this.AutoFindColumn = -1; this.Selection.FocusStyle = FocusStyle.None; // We handle all focus issues ourselves. In a multi-selection world this is important this.Invalidate(); }