private void Lb_Click(object sender, EventArgs e) { try { var lable = sender as LabelControl; if (Commons.Modules.iCongNhan == 0 && lable.Name != "labLyLich") { return; } if (tab == lable.Name) { return; } foreach (LabelControl lc in List) { if (lable.Name == lc.Name) { lc.Appearance.ForeColor = CommonColors.GetQuestionColor(DevExpress.LookAndFeel.UserLookAndFeel.Default); LoaduacCongNhan(lc.Name); tab = lable.Name; } else { lc.Appearance.ForeColor = Color.Empty; lc.Appearance.Font = this.Font; } } } catch { } }
protected override Matrix CreateStandardColors() { var i = 0; var standardColors = new Matrix(10, 3); CommonColors.OrderedForPicker().Each(color => { addColor(color, i / 10, i % 10, standardColors); i++; }); return(standardColors); }
public static Color GetColor(CommonColors color) { switch (color) { case CommonColors.BackgroundGrey: return(Color.FromArgb(255, 227, 227, 227)); case CommonColors.DarkGrey: return(Color.FromArgb(255, 57, 70, 76)); case CommonColors.GreyFontColor: return(Color.FromArgb(255, 47, 56, 61)); default: return(Color.FromArgb(50, 1, 156, 217)); } }
public static Color SelectNewColor(this CurveChart chart) { var colors = CommonColors.OrderedForCurves().ToList(); // select the next unused color (even if the color has been changed manually) foreach (var color in colors) { var colorUsed = chart.Curves.Any(curve => curve.Color == color); if (!colorUsed) { return(color); } } // if no unused color can be found, simply return the next color (repeating) // colors start with index 0 int newIndex = (chart.Curves.Count - 1) % colors.Count; return(colors[newIndex]); }
void PivotGridControlOnCustomDrawCell(object sender, PivotCustomDrawCellEventArgs e) { var fieldPeriod = PivotGridListEditor.PivotGridControl.Fields[Model.NetIncome.ColumnFieldName]; if (Equals(e.GetFieldValue(fieldPeriod), CurrentPeriod)) { var fieldMonth = PivotGridListEditor.PivotGridControl.Fields[Model.NetIncome.RowFieldName]; object month = e.GetFieldValue(fieldMonth); var fieldRevenue = PivotGridListEditor.PivotGridControl.Fields[Model.NetIncome.DataFieldName]; decimal currentValue = Convert.ToDecimal(e.GetCellValue(fieldRevenue)), compareValue = Convert.ToDecimal(e.GetCellValue(new object[] { ComparePeriod }, month != null ? new[] { e.GetFieldValue(fieldMonth) } : null, fieldRevenue)); if (currentValue > compareValue) { e.Appearance.ForeColor = CommonColors.GetInformationColor(UserLookAndFeel.Default); } else if (currentValue < compareValue) { e.Appearance.ForeColor = CommonColors.GetCriticalColor(UserLookAndFeel.Default); } } }
void UpdateCustomColors() { red = CommonColors.GetCriticalColor(DevExpress.LookAndFeel.UserLookAndFeel.Default); green = CommonColors.GetInformationColor(DevExpress.LookAndFeel.UserLookAndFeel.Default); }