public FormHelper(Control control) { _control = control; _form = control as System.Windows.Forms.Form; InDesignMode = ControlUtil.GetIsInDesignMode(control); if (InDesignMode) { return; } _defaultFontName = _control.Font.Name; _defaultFontSize = _control.Font.Size; var correctFont = SystemFonts.MessageBoxFont; if (!(_control is UserControl)) { _control.Font = correctFont; } _correctFontName = correctFont.Name; _correctFontSize = correctFont.Size; }
public FormFooter() { _designMode = ControlUtil.GetIsInDesignMode(this); SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw, true); Dock = DockStyle.Bottom; FlowDirection = FlowDirection.RightToLeft; AutoSize = true; }
public InformationBar() { _designMode = ControlUtil.GetIsInDesignMode(this); SetStyle(ControlStyles.DoubleBuffer | ControlStyles.ResizeRedraw, true); Items = new InformationCollection(this); TabStop = false; UpdateFont(); }
private void UpdateThemeData() { if (!ControlUtil.GetIsInDesignMode(this) && Application.RenderWithVisualStyles) { _borderColor = new VisualStyleRenderer("ListView", 0, 0).GetColor(ColorProperty.BorderColor); if (_borderColor == Color.Black) { _borderColor = SystemColors.ControlDark; } } else { _borderColor = SystemColors.ControlDark; } }