/// <summary>Initializes a new instance of the <see cref="ColorState" /> class.</summary> public ColorState() { VisualStyleManager _styleManager = new VisualStyleManager(Settings.DefaultValue.DefaultStyle); _disabled = Color.FromArgb(224, 224, 224); _enabled = _styleManager.ControlStyle.Background(0); }
/// <inheritdoc /> /// <summary> /// Initializes a new instance of the <see cref="T:VisualPlus.Toolkit.Controls.Editors.VisualColorPicker" /> /// class. /// </summary> public VisualColorPicker() { SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.Selectable | ControlStyles.StandardClick | ControlStyles.StandardDoubleClick | ControlStyles.SupportsTransparentBackColor, true); _styleManager = new VisualStyleManager(Settings.DefaultValue.DefaultStyle); _buttonColor = _styleManager.ColorStateStyle.ControlEnabled; _pickType = PickerType.Rectangle; Color = Color.Black; ColorStep = 4; SelectionSize = 10; SmallChange = 1; LargeChange = 5; _pickerVisible = true; _border = new Border(); _pickerBorder = new Border(); MinimumSize = new Size(130, 130); Size = new Size(130, 130); _pickerBorder.HoverVisible = false; Size = new Size(200, 100); UpdateLinearGradientBrushes(); UpdateGraphicsBuffer(); }
/// <inheritdoc /> /// <summary> /// Initializes a new instance of the /// <see cref="T:VisualPlus.Toolkit.Controls.Navigation.VisualContextMenuStrip" /> class. /// </summary> public VisualContextMenuStrip() { _styleManager = new VisualStyleManager(Settings.DefaultValue.DefaultStyle); Renderer = new VisualToolStripRender(); ConfigureStyleManager(); }
public void UpdateTheme(Styles style) { StyleManager = new VisualStyleManager(style); ForeColor = StyleManager.FontStyle.ForeColor; ForeColorDisabled = StyleManager.FontStyle.ForeColorDisabled; Font = StyleManager.Font; Invalidate(); }
/// <summary>Initializes a new instance of the <see cref="Hatch" /> class.</summary> public Hatch() { VisualStyleManager _styleManager = new VisualStyleManager(Settings.DefaultValue.DefaultStyle); _visible = Settings.DefaultValue.HatchVisible; _size = Settings.DefaultValue.HatchSize; _style = Settings.DefaultValue.HatchStyle; _backColor = _styleManager.ProgressStyle.Hatch; _foreColor = Color.FromArgb(40, _styleManager.ProgressStyle.Hatch); }
/// <inheritdoc /> /// <summary>Initializes a new instance of the <see cref="T:VisualPlus.Toolkit.Controls.Layout.VisualForm" /> class.</summary> public VisualForm() { SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); UpdateStyles(); _styleManager = new VisualStyleManager(Settings.DefaultValue.DefaultStyle); _resizeCursors = new[] { Cursors.SizeNESW, Cursors.SizeWE, Cursors.SizeNWSE, Cursors.SizeWE, Cursors.SizeNS }; _resizedLocationsCommand = new Dictionary <int, int> { { HTTOP, WMSZ_TOP }, { HTTOPLEFT, WMSZ_TOPLEFT }, { HTTOPRIGHT, WMSZ_TOPRIGHT }, { HTLEFT, WMSZ_LEFT }, { HTRIGHT, WMSZ_RIGHT }, { HTBOTTOM, WMSZ_BOTTOM }, { HTBOTTOMLEFT, WMSZ_BOTTOMLEFT }, { HTBOTTOMRIGHT, WMSZ_BOTTOMRIGHT } }; _titleAlignment = Alignment.TextAlignment.Center; FormBorderStyle = FormBorderStyle.None; Sizable = true; _closeColor = Color.IndianRed; _buttonBackHoverColor = _styleManager.ControlColorStateStyle.ControlHover; _buttonBackPressedColor = _styleManager.ControlColorStateStyle.ControlPressed; _buttonState = ButtonState.None; _maxColor = _styleManager.ControlStyle.FlatButtonEnabled; _minColor = _styleManager.ControlStyle.FlatButtonEnabled; _buttonSize = new Size(25, 25); _windowBarColor = _styleManager.ControlStyle.Background(0); _background = _styleManager.ControlStyle.Background(3); _magneticRadius = 100; _magnetic = true; _windowBarHeight = 30; TransparencyKey = Color.Fuchsia; DoubleBuffered = true; Padding = new Padding(0, 0, 0, 0); _border = new Border { Thickness = 3, Type = ShapeType.Rectangle }; _vsImage = new VisualBitmap(Resources.VisualPlus, new Size(16, 16)) { Visible = true }; _vsImage.Point = new Point(5, (_windowBarHeight / 2) - (_vsImage.Size.Height / 2)); // This enables the form to trigger the MouseMove event even when mouse is over another control Application.AddMessageFilter(new MouseMessageFilter()); MouseMessageFilter.MouseMove += OnGlobalMouseMove; }
/// <inheritdoc /> /// <summary>Initializes a new instance of the <see cref="T:VisualPlus.Toolkit.Controls.Interactivity.VisualKnob" /> class.</summary> public VisualKnob() { SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); VisualStyleManager _styleManager = new VisualStyleManager(Settings.DefaultValue.DefaultStyle); _pointerColor = _styleManager.ProgressStyle.Progress; UpdateStyles(); _knobFont = Font; ForeColor = Color.DimGray; _buttonDivisions = 30; _components = null; _endAngle = 405; _knobDistance = 35; _knobSize = new Size(90, 90); _knobTickSize = new Size(86, 86); _knobTopSize = new Size(75, 75); _largeChange = 5; _lineSize = new Size(1, 1); _maximum = 100; _mouseWheelBarPartitions = 10; _pointerStyle = PointerStyle.Circle; _scaleDivisions = 11; _scaleSubDivisions = 4; _showLargeScale = true; _showSmallScale = true; _smallChange = 1; _startAngle = 135; _tickColor = Color.DimGray; _valueVisible = true; _knobBorder = new Border(); _knobTopBorder = new Border { HoverVisible = false }; InitializeGradient(); InitializeComponent(); // "start angle" and "end angle" possible values: // 90 = bottom (minimum value for "start angle") // 180 = left // 270 = top // 360 = right // 450 = bottom again (maximum value for "end angle") // So the couple (90, 450) will give an entire circle and the couple (180, 360) will give half a circle. _deltaAngle = _endAngle - _startAngle; ConfigureDimensions(); }
/// <summary>Initializes a new instance of the <see cref="Watermark" /> class.</summary> public Watermark() { VisualStyleManager _styleManager = new VisualStyleManager(Settings.DefaultValue.DefaultStyle); activeColor = _styleManager.WatermarkStyle.ActiveColor; font = _styleManager.Font; inactiveColor = _styleManager.WatermarkStyle.InactiveColor; text = Settings.DefaultValue.WatermarkText; visible = Settings.DefaultValue.WatermarkVisible; Brush = new SolidBrush(inactiveColor); }
/// <inheritdoc /> /// <summary>Initializes a new instance of the <see cref="T:VisualPlus.Toolkit.VisualBase.BadgeLabel" /> class.</summary> public BadgeLabel() { VisualStyleManager _styleManager = new VisualStyleManager(Settings.DefaultValue.DefaultStyle); Background = Color.FromArgb(120, 183, 230); ForeColor = Color.White; Shape = new Shape(); Text = "0"; Font = _styleManager.Font; Location = new Point(0, 0); BackColor = Color.Transparent; Size = new Size(25, 20); }
public void UpdateTheme(Styles style) { StyleManager = new VisualStyleManager(style); ForeColor = StyleManager.FontStyle.ForeColor; ForeColorDisabled = StyleManager.FontStyle.ForeColorDisabled; BackColorState.Enabled = StyleManager.ControlStyle.Background(3); BackColorState.Disabled = StyleManager.ColorStateStyle.ControlDisabled; _progress = StyleManager.ProgressStyle.Progress; Invalidate(); }
/// <inheritdoc /> /// <summary> /// Initializes a new instance of the <see cref="T:VisualPlus.Toolkit.Controls.Navigation.VisualTabControl" /> /// class. /// </summary> public VisualTabControl() { SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); UpdateStyles(); _styleManager = new VisualStyleManager(Settings.DefaultValue.DefaultStyle); _border = new Border(); _alignment = TabAlignment.Top; _arrowSelectorVisible = true; _arrowSpacing = 10; _arrowThickness = 5; _itemSize = new Size(100, 25); _lineAlignment = StringAlignment.Near; _selectorAlignment = TabAlignment.Top; _selectorAlignment2 = TabAlignment.Bottom; _selectorThickness = 4; _separatorSpacing = 2; _separatorThickness = 2F; _backgroundColor = _styleManager.ControlStyle.Background(3); _separator = _styleManager.ControlStyle.Line; _tabMenu = Color.FromArgb(55, 61, 73); _textAlignment = StringAlignment.Center; _tabSelector = Color.Green; _textNormal = Color.FromArgb(174, 181, 187); _textRendererHint = Settings.DefaultValue.TextRenderingHint; _textSelected = Color.FromArgb(217, 220, 227); Font = _styleManager.Font; Size = new Size(320, 160); MinimumSize = new Size(144, 85); LineAlignment = StringAlignment.Center; ItemSize = _itemSize; _tabPageBorder = new Shape(); _tabNormal = _styleManager.TabStyle.TabEnabled; _tabSelected = _styleManager.TabStyle.TabSelected; _tabHover = _styleManager.TabStyle.TabHover; foreach (TabPage page in TabPages) { page.BackColor = _backgroundColor; page.Font = Font; } }
public void UpdateTheme(Styles style) { StyleManager = new VisualStyleManager(style); ForeColor = StyleManager.FontStyle.ForeColor; ForeColorDisabled = StyleManager.FontStyle.ForeColorDisabled; ForeColor = StyleManager.FontStyle.ForeColor; ForeColorDisabled = StyleManager.FontStyle.ForeColorDisabled; _line = StyleManager.ControlStyle.Line; _shadow = StyleManager.ControlStyle.Shadow; Invalidate(); }
public void UpdateTheme(Styles style) { StyleManager = new VisualStyleManager(style); _border.Color = StyleManager.ShapeStyle.Color; _border.HoverColor = StyleManager.BorderStyle.HoverColor; ForeColor = StyleManager.FontStyle.ForeColor; ForeColorDisabled = StyleManager.FontStyle.ForeColorDisabled; BackColorState.Enabled = StyleManager.ControlStyle.Background(0); BackColorState.Disabled = StyleManager.ControlStyle.Background(0); _borderEdge.BackColor = StyleManager.ControlStyle.Line; Invalidate(); }
public void UpdateTheme(Styles style) { StyleManager = new VisualStyleManager(style); _border.Color = StyleManager.ShapeStyle.Color; _border.HoverColor = StyleManager.BorderStyle.HoverColor; ForeColor = StyleManager.FontStyle.ForeColor; ForeColorDisabled = StyleManager.FontStyle.ForeColorDisabled; _colorState.Enabled = StyleManager.ControlStyle.Background(3); _colorState.Disabled = StyleManager.ControlStyle.Background(0); _itemNormal = BackColorState.Enabled; _itemAlternate = StyleManager.ShapeStyle.Color; _itemSelected = StyleManager.BorderStyle.HoverColor; Invalidate(); }
public void UpdateTheme(Styles style) { StyleManager = new VisualStyleManager(style); _border.Color = StyleManager.ShapeStyle.Color; _border.HoverColor = StyleManager.BorderStyle.HoverColor; ForeColor = StyleManager.FontStyle.ForeColor; ForeColorDisabled = StyleManager.FontStyle.ForeColorDisabled; BackColorState.Enabled = StyleManager.ControlStyle.Background(3); BackColorState.Disabled = StyleManager.ControlStyle.Background(0); _columnHeaderColor = StyleManager.ControlStyle.FlatButtonDisabled; headerText = StyleManager.FontStyle.ForeColor; itemBackground = StyleManager.ControlStyle.ItemEnabled; _itemSelected = StyleManager.BorderStyle.HoverColor; Invalidate(); }
/// <inheritdoc /> /// <summary>Initializes a new instance of the <see cref="T:VisualPlus.Toolkit.VisualBase.VisualControlBase" /> class.</summary> protected VisualControlBase() { // Allow transparent BackColor. SetStyle(ControlStyles.SupportsTransparentBackColor, true); // Double buffering to reduce drawing flicker. SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true); // Repaint entire control whenever resizing. SetStyle(ControlStyles.ResizeRedraw, true); // Drawn double buffered by default. DoubleBuffered = true; ResizeRedraw = true; _mouseState = MouseStates.Normal; _textRenderingHint = Settings.DefaultValue.TextRenderingHint; _styleManager = new VisualStyleManager(Settings.DefaultValue.DefaultStyle); }
/// <summary>Initializes a new instance of the <see cref="CheckStyle" /> class.</summary> /// <param name="boundary">The boundary.</param> public CheckStyle(Rectangle boundary) { VisualStyleManager _styleManager = new VisualStyleManager(Settings.DefaultValue.DefaultStyle); _color = _styleManager.CheckmarkStyle.CheckColor; _autoSize = true; _character = '✔'; _characterFont = _styleManager.Font; _checkType = CheckType.Character; _shapeRounding = Settings.DefaultValue.Rounding.BoxRounding; _shapeType = Settings.DefaultValue.BorderType; Bitmap _bitmap = new Bitmap(Image.FromStream(new MemoryStream(Convert.FromBase64String(VisualToggleRenderer.GetBase64CheckImage())))); _image = _bitmap; _bounds = boundary; }
public void UpdateTheme(Styles style) { StyleManager = new VisualStyleManager(style); ForeColor = StyleManager.FontStyle.ForeColor; ForeColorDisabled = StyleManager.FontStyle.ForeColorDisabled; Font = StyleManager.Font; BoxColorState.Enabled = StyleManager.ControlStyle.Background(0); BoxColorState.Disabled = Color.FromArgb(224, 224, 224); BoxColorState.Hover = Color.FromArgb(224, 224, 224); BoxColorState.Pressed = Color.Silver; CheckStyle.CheckColor = StyleManager.CheckmarkStyle.CheckColor; Border.Color = StyleManager.ShapeStyle.Color; Border.HoverColor = StyleManager.BorderStyle.HoverColor; Invalidate(); }
public void UpdateTheme(Styles style) { StyleManager = new VisualStyleManager(style); ForeColor = StyleManager.FontStyle.ForeColor; ForeColorDisabled = StyleManager.FontStyle.ForeColorDisabled; _colorState.Enabled = StyleManager.ProgressStyle.BackProgress; _colorState.Disabled = StyleManager.ProgressStyle.ProgressDisabled; _hatch.BackColor = StyleManager.ProgressStyle.Hatch; _hatch.ForeColor = Color.FromArgb(40, _hatch.BackColor); _progressColor = StyleManager.ProgressStyle.Progress; _border.Color = StyleManager.ShapeStyle.Color; _border.HoverColor = StyleManager.BorderStyle.HoverColor; Invalidate(); }
public void UpdateTheme(Styles style) { StyleManager = new VisualStyleManager(style); ForeColor = StyleManager.FontStyle.ForeColor; ForeColorDisabled = StyleManager.FontStyle.ForeColorDisabled; _controlColorState.Enabled = StyleManager.ControlStyle.Background(3); _controlColorState.Disabled = StyleManager.ControlStyle.Background(0); _buttonColorState.Enabled = StyleManager.ControlStyle.Background(0); _buttonColorState.Disabled = Color.FromArgb(224, 224, 224); _buttonColorState.Hover = Color.FromArgb(224, 224, 224); _buttonColorState.Pressed = Color.Silver; _border.Color = StyleManager.ShapeStyle.Color; _border.HoverColor = StyleManager.BorderStyle.HoverColor; _buttonBorder.Color = StyleManager.ShapeStyle.Color; _buttonBorder.HoverColor = StyleManager.BorderStyle.HoverColor; Invalidate(); }
/// <inheritdoc /> /// <summary> /// Initializes a new instance of the <see cref="T:VisualPlus.Toolkit.Controls.Interactivity.VisualComboBox" /> /// class. /// </summary> public VisualComboBox() { SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); SetStyle((ControlStyles)139286, true); SetStyle(ControlStyles.Selectable, false); _styleManager = new VisualStyleManager(Settings.DefaultValue.DefaultStyle); _buttonWidth = 30; _buttonHorizontal = Alignment.Horizontal.Right; _buttonStyles = DropDownButtons.Arrow; _buttonVisible = Settings.DefaultValue.TextVisible; _textAlignment = StringAlignment.Center; _watermark = new Watermark(); _backColorState = new ColorState(); _mouseState = MouseStates.Normal; DrawMode = DrawMode.OwnerDrawFixed; DropDownStyle = ComboBoxStyle.DropDownList; _borderEdge = new BorderEdge(); Size = new Size(135, 26); ItemHeight = 20; UpdateStyles(); DropDownHeight = 100; BackColor = SystemColors.Control; _border = new Border(); _textRendererHint = Settings.DefaultValue.TextRenderingHint; Controls.Add(_borderEdge); UpdateTheme(Settings.DefaultValue.DefaultStyle); }
public void UpdateTheme(Styles style) { StyleManager = new VisualStyleManager(style); _buttonForeColor = Color.Gray; _buttonFont = new Font(StyleManager.Font.FontFamily, 14, FontStyle.Bold); _buttonColor = StyleManager.ControlStyle.Background(3); ForeColor = StyleManager.FontStyle.ForeColor; ForeColorDisabled = StyleManager.FontStyle.ForeColorDisabled; _colorState.Enabled = StyleManager.ControlStyle.Background(3); _colorState.Disabled = StyleManager.ControlStyle.Background(0); _borderButtons.BackColor = StyleManager.ControlStyle.Line; _borderEdge.BackColor = StyleManager.ControlStyle.Line; _border.Color = StyleManager.ShapeStyle.Color; _border.HoverColor = StyleManager.BorderStyle.HoverColor; Invalidate(); }
public void UpdateTheme(Styles style) { StyleManager = new VisualStyleManager(style); ForeColor = StyleManager.FontStyle.ForeColor; ForeColorDisabled = StyleManager.FontStyle.ForeColorDisabled; Font = new Font(StyleManager.FontStyle.FontFamily, 16F, FontStyle.Bold); _subscriptFont = new Font(StyleManager.FontStyle.FontFamily, 8.25F, FontStyle.Bold); _superscriptFont = new Font(StyleManager.FontStyle.FontFamily, 8.25F, FontStyle.Bold); _superscriptColor = StyleManager.FontStyle.ForeColor; _subscriptColor = StyleManager.FontStyle.ForeColor; BackColorState.Enabled = StyleManager.ControlStyle.Background(0); BackColorState.Disabled = StyleManager.ControlStyle.Background(0); _backCircleColor = StyleManager.ProgressStyle.BackCircle; _foreCircleColor = StyleManager.ProgressStyle.ForeCircle; _progressColor = StyleManager.ProgressStyle.Progress; Invalidate(); }
/// <summary>Update the style of the control.</summary> /// <param name="style">The visual style.</param> public void UpdateTheme(Styles style) { _styleManager = new VisualStyleManager(Settings.DefaultValue.DefaultStyle); _border.Color = _styleManager.ShapeStyle.Color; _border.HoverColor = _styleManager.BorderStyle.HoverColor; Font = _styleManager.Font; _foreColor = _styleManager.FontStyle.ForeColor; _textDisabledColor = _styleManager.FontStyle.ForeColorDisabled; _backColorState.Enabled = _styleManager.ControlStyle.BoxEnabled; _backColorState.Disabled = _styleManager.ControlStyle.BoxDisabled; _buttonColor = _styleManager.ControlStyle.FlatButtonEnabled; _menuTextColor = _styleManager.FontStyle.ForeColor; _menuItemNormal = _styleManager.ControlStyle.ItemEnabled; _menuItemHover = _styleManager.ControlStyle.ItemHover; _borderEdge.BackColor = _styleManager.ControlStyle.Line; Invalidate(); }
/// <summary>Initializes a new instance of the <see cref="Border" /> class.</summary> public Border() { VisualStyleManager styleManager = new VisualStyleManager(Settings.DefaultValue.DefaultStyle); ConstructBorder(styleManager.BorderStyle.HoverColor, true); }
/// <summary>Initializes a new instance of the <see cref="Shape" /> class.</summary> public Shape() { VisualStyleManager styleManager = new VisualStyleManager(Settings.DefaultValue.DefaultStyle); ConstructShape(ShapeType.Rounded, styleManager.ShapeStyle.Color, Settings.DefaultValue.Rounding.Default, Settings.DefaultValue.BorderThickness, true); }