public static FontAndColor GeneralPickFontAndColor(IWin32Window who, FontAndColor what) { using (FontDialog fd = new FontDialog()) { fd.AllowSimulations = true; fd.ScriptsOnly = false; fd.ShowColor = true; fd.FontMustExist = true; fd.ShowEffects = true; fd.Font = what.Font; fd.Color = what.Color; if (fd.ShowDialog(who) == DialogResult.OK) { return new FontAndColor(fd.Font, fd.Color); } else return FontAndColor.Empty; } }
public TreeOptions() { rendermode = RenderMode.Walker; treealignment = TreeAlignmentEnum.Middle; marginhorizontal = 20; marginvertical = 20; paddinghorizontal = 0; paddingvertical = 5; tracehorizontal = 3; tracevertical = 10; backgroundcolor = Color.White; labelfont = new FontAndColor(DefaultFont(), Color.Black); lexicalfont = new FontAndColor(DefaultFont(), Color.Red); highlightcolor = Color.Blue; antialias = true; linestyle = new PenStyle(Color.Black, 1.0f, DashStyle.Solid, ArrowStyle.None); tracestyle = new PenStyle(Color.Black, 1.0f, DashStyle.Dot, ArrowStyle.LittleArrow); tracemode = TraceStyle.Line; }
public static string TextAndColorToRtf(string text, FontAndColor fc) { Dummy dummy = GetInstance(); dummy.Reset(); dummy.Text = text; dummy.SelectAll(); dummy.SelectionAlignment = HorizontalAlignment.Left; //hack dummy.SelectionFont = fc.Font; dummy.SelectionColor = fc.Color; return dummy.Rtf; }
private FontAndColor PickFontAndColor(FontAndColor input) { return GeneralPickFontAndColor(this, input); }