/// <summary> /// Helper to load Settings and populate the form elements /// <see cref="Settings"/> /// </summary> public void LoadSettings() { // line LineThickness = Settings.LineThickness; tB_LineThickness.Text = LineThickness.ToString(); LineMaxLength = Settings.LineMaxLength; tB_LineMaxLength.Text = LineMaxLength.ToString(); LineDividerLengthFactor = Settings.LineSubdividerLengthFactor; tB_LineDividerLengthFactor.Text = LineDividerLengthFactor.ToString(); ScaleStyle = Settings.Style; lB_ScaleStyle.DataStore = Enum.GetNames(typeof(ScaleOverlay.ScaleStyle)); // text TextHeight = Settings.TextHeight; tB_TextHeight.Text = TextHeight.ToString(); TextFont = Settings.TextFont; fP_TextFont.Value = TextFont.ToEtoFont(); // position OffsetX = Settings.OffsetX; tB_OffsetX.Text = OffsetX.ToString(); OffsetY = Settings.OffsetY; tB_OffsetY.Text = OffsetY.ToString(); TextGap = Settings.TextGap; tB_TextGap.Text = TextGap.ToString(); // color LineColor = Settings.LineColor; btn_LineColor.BackgroundColor = LineColor.ToEto(); TextColor = Settings.TextColor; btn_TextColor.BackgroundColor = TextColor.ToEto(); }
private void btn_LineColor_Clicked(object sender, EventArgs e) { ColorDialog dialog = new ColorDialog { Color = LineColor.ToEto() }; if (dialog.ShowDialog(this) == DialogResult.Ok) { btn_LineColor.BackgroundColor = dialog.Color; LineColor = System.Drawing.Color.FromArgb(dialog.Color.ToArgb()); } }