diff --git a/Documents/Help/Changelog.md b/Documents/Help/Changelog.md
index 1a050048f..ce5ce26b8 100644
--- a/Documents/Help/Changelog.md
+++ b/Documents/Help/Changelog.md
@@ -6,6 +6,8 @@
## 2023-11-xx - Build 2311 - November 2023
* Complete [#827](https://github.com/Krypton-Suite/Standard-Toolkit/issues/827),Expose IPalette / PaletteBase as a public interface in KryptonManager
+* Resolved [#891](https://github.com/Krypton-Suite/Standard-Toolkit/issues/891), `LabelStyle` does not appear to have a default designer value
+* Implemented [#887](https://github.com/Krypton-Suite/Standard-Toolkit/issues/887), A 'LinkLabel' version of the `KryptonWrapLabel`
* Fixed the display of the initial selected theme in the "ThemeSelection ComboBox"
* Resolved [#876](https://github.com/Krypton-Suite/Standard-Toolkit/issues/876), `Office 365 - Black` does not display text correctly
* Resolved [#874](https://github.com/Krypton-Suite/Standard-Toolkit/issues/874), 80.xx Canary Nuget text is incorrrect
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs
index d22d08769..fc4a2d3b5 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonButton.cs
@@ -28,6 +28,7 @@ namespace Krypton.Toolkit
public class KryptonButton : VisualSimpleBase, IButtonControl, IContentValues
{
#region Instance Fields
+
private readonly ViewDrawButton _drawButton;
private ButtonStyle _style;
private readonly ButtonController _buttonController;
@@ -37,7 +38,14 @@ public class KryptonButton : VisualSimpleBase, IButtonControl, IContentValues
private readonly PaletteTripleOverride _overrideTracking;
private readonly PaletteTripleOverride _overridePressed;
private IKryptonCommand _command;
- private bool _useAsDialogButton, _isDefault, _useMnemonic, _wasEnabled, _useAsUACElevationButton;
+ private bool _useAsDialogButton;
+ private bool _isDefault;
+ private bool _useMnemonic;
+ private bool _wasEnabled;
+ private bool _useAsUACElevationButton;
+ private Size _customUACShieldSize;
+ private UACShieldIconSize _uacShieldIconSize;
+
#endregion
#region Events
@@ -116,9 +124,13 @@ public KryptonButton()
ViewManager = new ViewManager(this, _drawButton);
_useAsDialogButton = false;
-
+
_useAsUACElevationButton = false;
+ _customUACShieldSize = new Size(16, 16);
+
+ _uacShieldIconSize = UACShieldIconSize.ExtraSmall;
+
// Set `CornerRoundingRadius' to 'GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE' (-1)
CornerRoundingRadius = GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
}
@@ -237,26 +249,32 @@ private void ResetButtonStyle()
ButtonStyle = ButtonStyle.Standalone;
}
- [DefaultValue(false),
+ [DefaultValue(false),
Description(@"If set to true, the text will pair up with the equivalent KryptonManager's dialog button text result. (Note: You'll lose any previous text)")]
- public bool UseAsADialogButton
- {
- get => _useAsDialogButton;
- set => _useAsDialogButton = value;
+ public bool UseAsADialogButton
+ {
+ get => _useAsDialogButton;
+ set => _useAsDialogButton = value;
}
- [DefaultValue(false),
+ [DefaultValue(false),
Description(@"Transforms the button into a UAC elevated button.")]
- public bool UseAsUACElevationButton
- {
- get => _useAsUACElevationButton;
- set
- {
- _useAsUACElevationButton = value;
- ShowUACShield(value);
- }
+ public bool UseAsUACElevationButton
+ {
+ get => _useAsUACElevationButton;
+ set
+ {
+ _useAsUACElevationButton = value;
+ ShowUACShield(value);
+ }
}
+ [DefaultValue(null), Description(@"")]
+ public Size CustomUACShieldSize { get => _customUACShieldSize; set { _customUACShieldSize = value; UpdateShieldCustomSize(value); } }
+
+ [DefaultValue(typeof(UACShieldIconSize), @"UACShieldIconSize.ExtraSmall"), Description(@"")]
+ public UACShieldIconSize UACShieldIconSize { get => _uacShieldIconSize; set { _uacShieldIconSize = value; UpdateShieldSize(value); } }
+
///
/// Gets access to the button content.
///
@@ -267,6 +285,11 @@ public bool UseAsUACElevationButton
private bool ShouldSerializeValues() => !Values.IsDefault;
+ //[Category(@"Visuals"), Description(@"UAC Shield Values"), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ //public UACShieldValues UACShieldValues { get; }
+
+ //private bool ShouldSerializeUACShieldValues() => !UACShieldValues.IsDefault;
+
///
/// Gets access to the common button appearance that other states can override.
///
@@ -580,7 +603,7 @@ protected override void OnClick(EventArgs e)
{
owner.DialogResult = DialogResult;
}
- catch (InvalidEnumArgumentException )
+ catch (InvalidEnumArgumentException)
{
// Is it https://github.com/Krypton-Suite/Standard-Toolkit/issues/728
if (owner is KryptonMessageBoxForm)
@@ -710,7 +733,7 @@ protected virtual void SetStyles(ButtonStyle buttonStyle)
///
/// Set of button values.
/// Delegate for notifying paint requests.
- protected virtual ButtonValues CreateButtonValues(NeedPaintHandler needPaint) => new (needPaint);
+ protected virtual ButtonValues CreateButtonValues(NeedPaintHandler needPaint) => new(needPaint);
///
/// Raises the KryptonCommandChanged event.
@@ -794,6 +817,34 @@ private void ShowUACShield(bool showUACShield)
Values.Image = null;
}
}
+
+ private void UpdateShieldCustomSize(Size value) => UpdateShieldSize(UACShieldIconSize.Custom, value);
+
+ private void UpdateShieldSize(UACShieldIconSize value, Size? customSize = null)
+ {
+ switch (value)
+ {
+ case UACShieldIconSize.Custom:
+ Values.Image = GraphicsExtensions.ScaleImage(Values.Image, customSize);
+ break;
+ case UACShieldIconSize.ExtraSmall:
+ Values.Image = GraphicsExtensions.ScaleImage(Values.Image, new Size(16, 16));
+ break;
+ case UACShieldIconSize.Small:
+ Values.Image = GraphicsExtensions.ScaleImage(Values.Image, new Size(32, 32));
+ break;
+ case UACShieldIconSize.Medium:
+ Values.Image = GraphicsExtensions.ScaleImage(Values.Image, new Size(64, 64));
+ break;
+ case UACShieldIconSize.Large:
+ Values.Image = GraphicsExtensions.ScaleImage(Values.Image, new Size(128, 128));
+ break;
+ case UACShieldIconSize.ExtraLarge:
+ Values.Image = GraphicsExtensions.ScaleImage(Values.Image, new Size(255, 255));
+ break;
+ }
+ }
+
#endregion
}
}
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonForm.cs
index fbc45bd61..a71369bb1 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonForm.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonForm.cs
@@ -186,7 +186,7 @@ public KryptonForm()
// Create the view manager instance
ViewManager = new ViewManager(this, _drawDocker);
-
+
// Set the CornerRoundingRadius to 'GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE', default value
CornerRoundingRadius = GlobalStaticValues.PRIMARY_CORNER_ROUNDING_VALUE;
@@ -1616,7 +1616,7 @@ private void OnShowToolTip(object sender, ToolTipEventArgs e)
PaletteBackStyle.ControlToolTip,
PaletteBorderStyle.ControlToolTip,
CommonHelper.ContentStyleFromLabelStyle(toolTipStyle),
- shadow);
+ shadow);
_visualPopupToolTip.Disposed += OnVisualPopupToolTipDisposed;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonLabel.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonLabel.cs
index 1e22b6db5..bfb04d469 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonLabel.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonLabel.cs
@@ -191,7 +191,7 @@ private void ResetOrientation()
///
[Category(@"Visuals")]
[Description(@"Label style.")]
- [DefaultValue(typeof(LabelStyle), "NormalPanel")]
+ [DefaultValue(typeof(LabelStyle), "LabelStyle.NormalPanel")]
public LabelStyle LabelStyle
{
get => _style;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonLinkWrapLabel.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonLinkWrapLabel.cs
new file mode 100644
index 000000000..19438adf7
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonLinkWrapLabel.cs
@@ -0,0 +1,866 @@
+#region BSD License
+/*
+ *
+ * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Toolkit
+{
+ ///
+ /// Display a windows forms label but with Krypton palette text and font settings.
+ ///
+ [ToolboxItem(true)]
+ [ToolboxBitmap(typeof(KryptonLinkWrapLabel), "ToolboxBitmaps.KryptonWrapLabel.bmp")]
+ [DefaultEvent("LinkClicked")]
+ [DefaultProperty("Text")]
+ [DefaultBindingProperty("Text")]
+ [Designer("Krypton.Toolkit.KryptonLinkWrapLabelDesigner, Krypton.Toolkit")]
+ [DesignerCategory(@"code")]
+ [Description(@"Displays descriptive information.")]
+ public sealed class KryptonLinkWrapLabel : LinkLabel
+ {
+ #region Static Field
+ private static MethodInfo _miPTB;
+ #endregion
+
+ #region Instance Fields
+
+ private PaletteBase _localPalette;
+ private PaletteBase _palette;
+ private PaletteMode _paletteMode;
+ private readonly PaletteRedirect _redirector;
+ private LabelStyle _labelStyle;
+ private PaletteContentStyle _labelContentStyle;
+ private KryptonContextMenu _kryptonContextMenu;
+ private bool _globalEvents;
+
+ #endregion
+
+ #region Events
+ ///
+ /// Occurs when the palette changes.
+ ///
+ [Category(@"Property Changed")]
+ [Description(@"Occurs when the value of the Palette property is changed.")]
+ public event EventHandler PaletteChanged;
+ #endregion
+
+ #region Identity
+
+
+ /// Initializes a new instance of the class.
+ public KryptonLinkWrapLabel()
+ {
+ // We use double buffering to reduce drawing flicker
+ SetStyle(ControlStyles.OptimizedDoubleBuffer |
+ ControlStyles.AllPaintingInWmPaint |
+ ControlStyles.UserPaint, true);
+
+ // We need to repaint entire control whenever resized
+ SetStyle(ControlStyles.ResizeRedraw, true);
+
+ // Yes, we want to be drawn double buffered by default
+ DoubleBuffered = true;
+
+ // Create the state storage
+ StateCommon = new PaletteWrapLabel(this);
+ StateNormal = new PaletteWrapLabel(this);
+ StateDisabled = new PaletteWrapLabel(this);
+
+ // Set the palette to the defaults as specified by the manager
+ _localPalette = null;
+ SetPalette(KryptonManager.CurrentGlobalPalette);
+ _paletteMode = PaletteMode.Global;
+ AttachGlobalEvents();
+
+ // Create constant target for resolving palette delegates
+ _redirector = CreateRedirector();
+
+ // Default properties
+ SetLabelStyle(LabelStyle.NormalPanel);
+ AutoSize = true;
+ TabStop = false;
+ }
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ // Must unhook from the palette paint event
+ if (_palette != null)
+ {
+ _palette.PalettePaint -= OnPaletteNeedPaint;
+ _palette.BasePaletteChanged -= OnBaseChanged;
+ _palette.BaseRendererChanged -= OnBaseChanged;
+ }
+
+ UnattachGlobalEvents();
+
+ _palette = null;
+ _localPalette = null;
+ _redirector.Target = null;
+ Renderer = null;
+ }
+
+ base.Dispose(disposing);
+ }
+ #endregion
+
+ #region Public
+ ///
+ /// Gets access to the target for mnemonic and click actions.
+ ///
+ [Category(@"Visuals")]
+ [Description(@"Target control for mnemonic and click actions.")]
+ [DefaultValue(null)]
+ public Control Target { get; set; }
+
+ ///
+ /// Gets or sets the tab order of the KryptonSplitterPanel within its KryptonSplitContainer.
+ ///
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public new int TabIndex
+ {
+ get => base.TabIndex;
+ set => base.TabIndex = value;
+ }
+
+ ///
+ /// Gets or sets a value indicating whether the user can give the focus to this KryptonSplitterPanel using the TAB key.
+ ///
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public new bool TabStop
+ {
+ get => base.TabStop;
+ set => base.TabStop = value;
+ }
+
+ ///
+ /// Gets or sets the background color for the control.
+ ///
+ [Browsable(false)]
+ [Bindable(false)]
+ public override Color BackColor
+ {
+ get => base.BackColor;
+ set => base.BackColor = value;
+ }
+
+ ///
+ /// Gets or sets the font of the text Displayed by the control.
+ ///
+ [Browsable(false)]
+ [Bindable(false)]
+ public override Font Font
+ {
+ get => base.Font;
+ set => base.Font = value;
+ }
+
+ ///
+ /// Gets or sets the foreground color for the control.
+ ///
+ [Browsable(false)]
+ [Bindable(false)]
+ public override Color ForeColor
+ {
+ get => base.ForeColor;
+ set => base.ForeColor = value;
+ }
+
+ ///
+ /// Determines if the label has a border.
+ ///
+ [Browsable(false)]
+ [Bindable(false)]
+ public override BorderStyle BorderStyle
+ {
+ get => base.BorderStyle;
+ set => base.BorderStyle = value;
+ }
+
+ ///
+ /// Determines appearance of the control when the mouse pressed on the label.
+ ///
+ [Browsable(false)]
+ [Bindable(false)]
+ public new FlatStyle FlatStyle
+ {
+ get => base.FlatStyle;
+ set => base.FlatStyle = value;
+ }
+
+ ///
+ /// Gets and sets the automatic resize of the control to fit contents.
+ ///
+ [DefaultValue(true)]
+ public override bool AutoSize
+ {
+ get => base.AutoSize;
+ set => base.AutoSize = value;
+ }
+
+ ///
+ /// Gets access to the common wrap label appearance that other states can override.
+ ///
+ [Category(@"Visuals")]
+ [Description(@"Overrides for defining common wrap label appearance that other states can override.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public PaletteWrapLabel StateCommon { get; }
+
+ private bool ShouldSerializeStateCommon() => !StateCommon.IsDefault;
+
+ ///
+ /// Gets access to the disabled wrap label appearance.
+ ///
+ [Category(@"Visuals")]
+ [Description(@"Overrides for defining disabled wrap label appearance.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public PaletteWrapLabel StateDisabled { get; }
+
+ private bool ShouldSerializeStateDisabled() => !StateDisabled.IsDefault;
+
+ ///
+ /// Gets access to the normal wrap label appearance.
+ ///
+ [Category(@"Visuals")]
+ [Description(@"Overrides for defining normal wrap label appearance.")]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
+ public PaletteWrapLabel StateNormal { get; }
+
+ private bool ShouldSerializeStateNormal() => !StateNormal.IsDefault;
+
+
+ ///
+ /// Gets and sets the label style.
+ ///
+ [Category(@"Visuals")]
+ [Description(@"Label style.")]
+ [DefaultValue(typeof(LabelStyle), "LabelStyle.NormalPanel")]
+ public LabelStyle LabelStyle
+ {
+ get => _labelStyle;
+
+ set
+ {
+ if (_labelStyle != value)
+ {
+ _labelStyle = value;
+ SetLabelStyle(_labelStyle);
+ Refresh();
+ }
+ }
+ }
+
+ private bool ShouldSerializeLabelStyle() => LabelStyle != LabelStyle.NormalPanel;
+
+ private void ResetLabelStyle() => LabelStyle = LabelStyle.NormalPanel;
+
+ ///
+ /// Gets or sets the palette to be applied.
+ ///
+ [Category(@"Visuals")]
+ [Description(@"Palette applied to drawing.")]
+ public PaletteMode PaletteMode
+ {
+ [DebuggerStepThrough]
+ get => _paletteMode;
+
+ set
+ {
+ if (_paletteMode != value)
+ {
+ // Action depends on new value
+ switch (value)
+ {
+ case PaletteMode.Custom:
+ // Do nothing, you must assign a palette to the
+ // 'Palette' property in order to get the custom mode
+ break;
+ default:
+ // Use the new value
+ _paletteMode = value;
+
+ // Get a reference to the standard palette from its name
+ _localPalette = null;
+ SetPalette(KryptonManager.GetPaletteForMode(_paletteMode));
+
+ // Must raise event to change palette in redirector
+ OnPaletteChanged(EventArgs.Empty);
+ NeedPaint(true);
+ break;
+ }
+ }
+ }
+ }
+
+ private bool ShouldSerializePaletteMode() => PaletteMode != PaletteMode.Global;
+
+ ///
+ /// Resets the PaletteMode property to its default value.
+ ///
+ public void ResetPaletteMode() => PaletteMode = PaletteMode.Global;
+
+ ///
+ /// Gets and sets the custom palette implementation.
+ ///
+ [Category(@"Visuals")]
+ [Description(@"Custom palette applied to drawing.")]
+ [DefaultValue(null)]
+ public PaletteBase Palette
+ {
+ [DebuggerStepThrough]
+ get => _localPalette;
+
+ set
+ {
+ // Only interested in changes of value
+ if (_localPalette != value)
+ {
+ // Remember the starting palette
+ PaletteBase old = _localPalette;
+
+ // Use the provided palette value
+ SetPalette(value);
+
+ // If no custom palette is required
+ if (value == null)
+ {
+ // No custom palette, so revert back to the global setting
+ _paletteMode = PaletteMode.Global;
+
+ // Get the appropriate palette for the global mode
+ _localPalette = null;
+ SetPalette(KryptonManager.GetPaletteForMode(_paletteMode));
+ }
+ else
+ {
+ // No longer using a standard palette
+ _localPalette = value;
+ _paletteMode = PaletteMode.Custom;
+ }
+
+ // If real change has occurred
+ if (old != _localPalette)
+ {
+ // Raise the change event
+ OnPaletteChanged(EventArgs.Empty);
+ NeedPaint(true);
+ }
+ }
+ }
+ }
+
+ ///
+ /// Resets the Palette property to its default value.
+ ///
+ public void ResetPalette() => PaletteMode = PaletteMode.Global;
+
+ ///
+ /// Gets and sets the KryptonContextMenu to show when right clicked.
+ ///
+ [Category(@"Behavior")]
+ [Description(@"The shortcut menu to show when the user right-clicks the page.")]
+ [DefaultValue(null)]
+ public KryptonContextMenu KryptonContextMenu
+ {
+ get => _kryptonContextMenu;
+
+ set
+ {
+ if (_kryptonContextMenu != value)
+ {
+ if (_kryptonContextMenu != null)
+ {
+ _kryptonContextMenu.Closed -= OnContextMenuClosed;
+ _kryptonContextMenu.Disposed -= OnKryptonContextMenuDisposed;
+ }
+
+ _kryptonContextMenu = value;
+
+ if (_kryptonContextMenu != null)
+ {
+ _kryptonContextMenu.Closed += OnContextMenuClosed;
+ _kryptonContextMenu.Disposed += OnKryptonContextMenuDisposed;
+ }
+ }
+ }
+ }
+
+ ///
+ /// Gets the resolved palette to actually use when drawing.
+ ///
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public PaletteBase GetResolvedPalette() => _palette;
+
+ ///
+ /// Gets access to the current renderer.
+ ///
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public IRenderer Renderer
+ {
+ [DebuggerStepThrough]
+ get;
+ private set;
+ }
+
+ ///
+ /// Create a tool strip renderer appropriate for the current renderer/palette pair.
+ ///
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ public ToolStripRenderer CreateToolStripRenderer() => Renderer.RenderToolStrip(GetResolvedPalette());
+
+ ///
+ /// Update the font property.
+ ///
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void UpdateFont()
+ {
+ Font font;
+ Color textColor;
+ PaletteTextHint hint;
+ PaletteState ps = PaletteState.Normal;
+
+ // Get values from correct enabled/disabled state
+ if (Enabled)
+ {
+ font = StateNormal.Font;
+ textColor = StateNormal.TextColor;
+ hint = StateNormal.Hint;
+ }
+ else
+ {
+ font = StateDisabled.Font;
+ textColor = StateDisabled.TextColor;
+ hint = StateDisabled.Hint;
+ ps = PaletteState.Disabled;
+ }
+
+ // Recover font from state common or as last resort the inherited palette
+ font ??= StateCommon.Font ?? _redirector.GetContentShortTextFont(_labelContentStyle, ps);
+
+ // Recover text color from state common or as last resort the inherited palette
+ if (textColor == Color.Empty)
+ {
+ textColor = StateCommon.TextColor;
+ if (textColor == Color.Empty)
+ {
+ textColor = _redirector.GetContentShortTextColor1(_labelContentStyle, ps);
+ }
+ }
+
+ // Recover text hint from state common or as last resort the inherited palette
+ if (hint == PaletteTextHint.Inherit)
+ {
+ hint = StateCommon.Hint;
+ if (hint == PaletteTextHint.Inherit)
+ {
+ hint = _redirector.GetContentShortTextHint(_labelContentStyle, ps);
+ }
+ }
+
+ // Only update the font when the control is created
+ if (Handle != IntPtr.Zero)
+ {
+ Font = font;
+ }
+ }
+
+ ///
+ /// Attach the control to global events.
+ ///
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void AttachGlobalEvents()
+ {
+ if (!_globalEvents)
+ {
+ UpdateGlobalEvents(true);
+ _globalEvents = true;
+ }
+ }
+
+ ///
+ /// Attach the control to global events.
+ ///
+ [Browsable(false)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void UnattachGlobalEvents()
+ {
+ if (_globalEvents)
+ {
+ UpdateGlobalEvents(false);
+ _globalEvents = false;
+ }
+ }
+ #endregion
+
+ #region Protected
+ ///
+ /// Raises the PaletteChanged event.
+ ///
+ /// An EventArgs containing the event data.
+ private void OnPaletteChanged(EventArgs e)
+ {
+ // Update the redirector with latest palette
+ _redirector.Target = _palette;
+
+ // Layout and repaint with new settings
+ NeedPaint(true);
+
+ PaletteChanged?.Invoke(this, e);
+ }
+
+ ///
+ /// Raises the Paint event.
+ ///
+ /// An EventArgs containing the event data.
+ protected override void OnPaint(PaintEventArgs e)
+ {
+ Font font;
+ Color textColor;
+ PaletteTextHint hint;
+ PaletteState ps = PaletteState.Normal;
+
+ // Get values from correct enabled/disabled state
+ if (Enabled)
+ {
+ font = StateNormal.Font;
+ textColor = StateNormal.TextColor;
+ hint = StateNormal.Hint;
+ }
+ else
+ {
+ font = StateDisabled.Font;
+ textColor = StateDisabled.TextColor;
+ hint = StateDisabled.Hint;
+ ps = PaletteState.Disabled;
+ }
+
+ // Recover font from state common or as last resort the inherited palette
+ font ??= StateCommon.Font ?? _redirector.GetContentShortTextFont(_labelContentStyle, ps);
+
+ // Recover text color from state common or as last resort the inherited palette
+ if (textColor == Color.Empty)
+ {
+ textColor = StateCommon.TextColor;
+ if (textColor == Color.Empty)
+ {
+ textColor = _redirector.GetContentShortTextColor1(_labelContentStyle, ps);
+ }
+ }
+
+ // Recover text hint from state common or as last resort the inherited palette
+ if (hint == PaletteTextHint.Inherit)
+ {
+ hint = StateCommon.Hint;
+ if (hint == PaletteTextHint.Inherit)
+ {
+ hint = _redirector.GetContentShortTextHint(_labelContentStyle, ps);
+ }
+ }
+
+ // Only update the font when the control is created
+ if (Handle != IntPtr.Zero)
+ {
+ Font = font;
+ }
+
+ ForeColor = textColor;
+ e.Graphics.TextRenderingHint = CommonHelper.PaletteTextHintToRenderingHint(hint);
+
+ base.OnPaint(e);
+ }
+
+ ///
+ /// Raises the PaintBackground event.
+ ///
+ /// An PaintEventArgs containing the event data.
+ protected override void OnPaintBackground(PaintEventArgs pEvent)
+ {
+ // Do we have a parent control and we need to paint background?
+ if (Parent != null)
+ {
+ // Only grab the required reference once
+ if (_miPTB == null)
+ {
+ // Use reflection so we can call the Windows Forms internal method for painting parent background
+ _miPTB = typeof(Control).GetMethod("PaintTransparentBackground",
+ BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod,
+ null, CallingConventions.HasThis,
+ new[] { typeof(PaintEventArgs), typeof(Rectangle), typeof(Region) },
+ null);
+ }
+
+ _miPTB.Invoke(this, new object[] { pEvent, ClientRectangle, null });
+ }
+ else
+ {
+ base.OnPaintBackground(pEvent);
+ }
+ }
+
+ ///
+ /// Create the redirector instance.
+ ///
+ /// PaletteRedirect derived class.
+ private PaletteRedirect CreateRedirector() => new(_palette);
+
+ ///
+ /// Update the view elements based on the requested label style.
+ ///
+ /// New label style.
+ private void SetLabelStyle(LabelStyle style) => _labelContentStyle = CommonHelper.ContentStyleFromLabelStyle(style);
+
+ ///
+ /// Update global event attachments.
+ ///
+ /// True if attaching; otherwise false.
+ private void UpdateGlobalEvents(bool attach)
+ {
+ if (attach)
+ {
+ KryptonManager.GlobalPaletteChanged += OnGlobalPaletteChanged;
+ SystemEvents.UserPreferenceChanged += OnUserPreferenceChanged;
+ }
+ else
+ {
+ KryptonManager.GlobalPaletteChanged -= OnGlobalPaletteChanged;
+ SystemEvents.UserPreferenceChanged -= OnUserPreferenceChanged;
+ }
+ }
+
+ ///
+ /// Processes a command key.
+ ///
+ /// A Message, passed by reference, that represents the window message to process.
+ /// One of the Keys values that represents the key to process.
+ /// True is handled; otherwise false.
+ protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
+ {
+ // If we have a defined context menu then need to check for matching shortcut
+ if (KryptonContextMenu != null)
+ {
+ if (KryptonContextMenu.ProcessShortcut(keyData))
+ {
+ return true;
+ }
+ }
+
+ return base.ProcessCmdKey(ref msg, keyData);
+ }
+
+ ///
+ /// Processes a mnemonic character.
+ ///
+ /// The mnemonic character entered.
+ /// true if the mnemonic was processed; otherwise, false.
+ protected override bool ProcessMnemonic(char charCode)
+ {
+ // Are we allowed to process mnemonic?
+ if (UseMnemonic && CanProcessMnemonic())
+ {
+ // Does the button primary text contain the mnemonic?
+ if (IsMnemonic(charCode, Text))
+ {
+ // Do we have a target that can take the focus
+ if (Target is { CanFocus: true })
+ {
+ Target.Focus();
+ return true;
+ }
+ }
+ }
+
+ // No match found, let base class do standard processing
+ return base.ProcessMnemonic(charCode);
+ }
+
+ ///
+ /// Process Windows-based messages.
+ ///
+ /// A Windows-based message.
+ protected override void WndProc(ref Message m)
+ {
+ // We need to snoop the need to show a context menu
+ if (m.Msg == PI.WM_.CONTEXTMENU)
+ {
+ // Only interested in overriding the behavior when we have a krypton context menu...
+ if (KryptonContextMenu != null)
+ {
+ // Extract the screen mouse position (if might not actually be provided)
+ Point mousePt = new(PI.LOWORD(m.LParam), PI.HIWORD(m.LParam));
+
+ // If keyboard activated, the menu position is centered
+ if (((int)(long)m.LParam) == -1)
+ {
+ mousePt = new Point(Width / 2, Height / 2);
+ }
+ else
+ {
+ mousePt = PointToClient(mousePt);
+
+ // Mouse point up and left 1 pixel so that the mouse overlaps the top left corner
+ // of the showing context menu just like it happens for a ContextMenuStrip.
+ mousePt.X -= 1;
+ mousePt.Y -= 1;
+ }
+
+ // If the mouse position is within our client area
+ if (ClientRectangle.Contains(mousePt))
+ {
+ // Show the context menu
+ KryptonContextMenu.Show(this, PointToScreen(mousePt));
+
+ // We eat the message!
+ return;
+ }
+ }
+ }
+
+ base.WndProc(ref m);
+ }
+
+ ///
+ /// Called when a context menu has just been closed.
+ ///
+ private void ContextMenuClosed()
+ {
+ }
+ #endregion
+
+ #region Implementation
+ ///
+ /// Gets a value indicating is processing of mnemonics should be allowed.
+ ///
+ /// True to allow; otherwise false.
+ private bool CanProcessMnemonic()
+ {
+ Control c = this;
+
+ // Test each control in parent chain
+ while (c != null)
+ {
+ // Control must be visible and enabled
+ if (!c.Visible || !c.Enabled)
+ {
+ return false;
+ }
+
+ // Move up one level
+ c = c.Parent;
+ }
+
+ // Every control in chain is visible and enabled, so allow mnemonics
+ return true;
+ }
+
+ /// Sets the palette.
+ /// The palette.
+ private void SetPalette(PaletteBase palette)
+ {
+ if (palette != _palette)
+ {
+ // Unhook from current palette events
+ if (_palette != null)
+ {
+ _palette.PalettePaint -= OnPaletteNeedPaint;
+ _palette.BasePaletteChanged -= OnBaseChanged;
+ _palette.BaseRendererChanged -= OnBaseChanged;
+ }
+
+ // Remember the new palette
+ _palette = palette;
+
+ // Get the renderer associated with the palette
+ Renderer = _palette.GetRenderer();
+
+ // Hook to new palette events
+ if (_palette != null)
+ {
+ _palette.PalettePaint += OnPaletteNeedPaint;
+ _palette.BasePaletteChanged += OnBaseChanged;
+ _palette.BaseRendererChanged += OnBaseChanged;
+ }
+ }
+ }
+
+ private void OnPaletteNeedPaint(object sender, NeedLayoutEventArgs e) => NeedPaint(e);
+
+ // Change in base renderer or base palette require we fetch the latest renderer
+ private void OnBaseChanged(object sender, EventArgs e) => Renderer = _palette.GetRenderer();
+
+ /// Called when [global palette changed].
+ /// The sender.
+ /// The instance containing the event data.
+ private void OnGlobalPaletteChanged(object sender, EventArgs e)
+ {
+ // We only care if we are using the global palette
+ if (PaletteMode == PaletteMode.Global)
+ {
+ // Update ourself with the new global palette
+ _localPalette = null;
+ SetPalette(KryptonManager.CurrentGlobalPalette);
+ _redirector.Target = _palette;
+
+ // A new palette source means we need to layout and redraw
+ NeedPaint(true);
+
+ // Must raise event to change palette in redirector
+ OnPaletteChanged(EventArgs.Empty);
+ }
+ }
+
+ private void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e) => NeedPaint(true);
+
+ private void OnContextMenuStripOpening(object sender, CancelEventArgs e)
+ {
+ // Get the actual strip instance
+ // ReSharper disable RedundantBaseQualifier
+ ContextMenuStrip cms = base.ContextMenuStrip;
+ // ReSharper restore RedundantBaseQualifier
+
+ // Make sure it has the correct renderer
+ cms.Renderer = CreateToolStripRenderer();
+ }
+
+ private void OnKryptonContextMenuDisposed(object sender, EventArgs e)
+ {
+ // When the current krypton context menu is disposed, we should remove
+ // it to prevent it being used again, as that would just throw an exception
+ // because it has been disposed.
+ KryptonContextMenu = null;
+ }
+
+ private void OnContextMenuClosed(object sender, ToolStripDropDownClosedEventArgs e) => ContextMenuClosed();
+
+ private void NeedPaint(bool layout) => NeedPaint(new NeedLayoutEventArgs(layout));
+
+ private void NeedPaint(NeedLayoutEventArgs e)
+ {
+ if (e.NeedLayout)
+ {
+ PerformLayout();
+ }
+
+ Invalidate();
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonWrapLabel.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonWrapLabel.cs
index cbc54a2fe..00b2de0fa 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonWrapLabel.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonWrapLabel.cs
@@ -249,7 +249,7 @@ public override bool AutoSize
///
[Category(@"Visuals")]
[Description(@"Label style.")]
- [DefaultValue(typeof(LabelStyle), "NormalPanel")]
+ [DefaultValue(typeof(LabelStyle), "LabelStyle.NormalPanel")]
public LabelStyle LabelStyle
{
get => _labelStyle;
@@ -622,7 +622,7 @@ protected override void OnPaintBackground(PaintEventArgs pEvent)
/// Create the redirector instance.
///
/// PaletteRedirect derived class.
- private PaletteRedirect CreateRedirector() => new (_palette);
+ private PaletteRedirect CreateRedirector() => new(_palette);
///
/// Update the view elements based on the requested label style.
diff --git a/Source/Krypton Components/Krypton.Toolkit/Designers/Action Lists/KryptonLinkWrapLabelActionList.cs b/Source/Krypton Components/Krypton.Toolkit/Designers/Action Lists/KryptonLinkWrapLabelActionList.cs
new file mode 100644
index 000000000..cdb652e56
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Designers/Action Lists/KryptonLinkWrapLabelActionList.cs
@@ -0,0 +1,112 @@
+#region BSD License
+/*
+ *
+ * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Toolkit
+{
+ internal class KryptonLinkWrapLabelActionList : DesignerActionList
+ {
+ #region Instance Fields
+ private readonly KryptonLinkWrapLabel _linkWrapLabel;
+ private readonly IComponentChangeService _service;
+ #endregion
+
+ #region Identity
+ ///
+ /// Initialize a new instance of the KryptonLinkWrapLabelActionList class.
+ ///
+ /// Designer that owns this action list instance.
+ public KryptonLinkWrapLabelActionList(KryptonLinkWrapLabelDesigner owner)
+ : base(owner.Component)
+ {
+ // Remember the label instance
+ _linkWrapLabel = owner.Component as KryptonLinkWrapLabel;
+
+ // Cache service used to notify when a property has changed
+ _service = (IComponentChangeService)GetService(typeof(IComponentChangeService));
+ }
+ #endregion
+
+ #region Public
+ ///
+ /// Gets and sets the label style.
+ ///
+ public LabelStyle LabelStyle
+ {
+ get => _linkWrapLabel.LabelStyle;
+
+ set
+ {
+ if (_linkWrapLabel.LabelStyle != value)
+ {
+ _service.OnComponentChanged(_linkWrapLabel, null, _linkWrapLabel.LabelStyle, value);
+ _linkWrapLabel.LabelStyle = value;
+ }
+ }
+ }
+
+ ///
+ /// Gets and sets the palette mode.
+ ///
+ public PaletteMode PaletteMode
+ {
+ get => _linkWrapLabel.PaletteMode;
+
+ set
+ {
+ if (_linkWrapLabel.PaletteMode != value)
+ {
+ _service.OnComponentChanged(_linkWrapLabel, null, _linkWrapLabel.PaletteMode, value);
+ _linkWrapLabel.PaletteMode = value;
+ }
+ }
+ }
+
+ /// Gets or sets the font.
+ /// The font.
+ public Font Font
+ {
+ get => _linkWrapLabel.StateCommon.Font;
+
+ set
+ {
+ if (_linkWrapLabel.StateCommon.Font != value)
+ {
+ _service.OnComponentChanged(_linkWrapLabel, null, _linkWrapLabel.StateCommon.Font, value);
+
+ _linkWrapLabel.StateCommon.Font = value;
+ }
+ }
+ }
+ #endregion
+
+ #region Public Override
+ ///
+ /// Returns the collection of DesignerActionItem objects contained in the list.
+ ///
+ /// A DesignerActionItem array that contains the items in this list.
+ public override DesignerActionItemCollection GetSortedActionItems()
+ {
+ // Create a new collection for holding the single item we want to create
+ DesignerActionItemCollection actions = new();
+
+ // This can be null when deleting a control instance at design time
+ if (_linkWrapLabel != null)
+ {
+ actions.Add(new DesignerActionHeaderItem(@"Appearance"));
+ actions.Add(new DesignerActionPropertyItem(@"LabelStyle", @"Style", @"Appearance", @"Label style"));
+ actions.Add(new DesignerActionPropertyItem(@"Font", @"Font", @"Appearance", @"The wrap label font."));
+ actions.Add(new DesignerActionHeaderItem(@"Visuals"));
+ actions.Add(new DesignerActionPropertyItem(@"PaletteMode", @"Palette", @"Visuals", @"Palette applied to drawing"));
+ }
+
+ return actions;
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Designers/Designers/KryptonLinkWrapLabelDesigner.cs b/Source/Krypton Components/Krypton.Toolkit/Designers/Designers/KryptonLinkWrapLabelDesigner.cs
new file mode 100644
index 000000000..25b37afe8
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Designers/Designers/KryptonLinkWrapLabelDesigner.cs
@@ -0,0 +1,46 @@
+#region BSD License
+/*
+ *
+ * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Toolkit
+{
+ internal class KryptonLinkWrapLabelDesigner : ControlDesigner
+ {
+ #region Identity
+
+ /// Initializes a new instance of the class.
+ public KryptonLinkWrapLabelDesigner() =>
+ // The resizing handles around the control need to change depending on the
+ // value of the AutoSize and AutoSizeMode properties. When in AutoSize you
+ // do not get the resizing handles, otherwise you do.
+ AutoResizeHandles = true;
+
+ #endregion
+
+ #region Public Overrides
+ ///
+ /// Gets the design-time action lists supported by the component associated with the designer.
+ ///
+ public override DesignerActionListCollection ActionLists
+ {
+ get
+ {
+ // Create a collection of action lists
+ DesignerActionListCollection actionLists = new()
+ {
+
+ // Add the wrap label specific list
+ new KryptonLinkWrapLabelActionList(this)
+ };
+
+ return actionLists;
+ }
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteWrapLabel.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteWrapLabel.cs
index 8adf762a4..f753f2f18 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteWrapLabel.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Palette Controls/PaletteWrapLabel.cs
@@ -22,6 +22,7 @@ public class PaletteWrapLabel : Storage
private Color _textColor;
private PaletteTextHint _hint;
private readonly KryptonWrapLabel _wrapLabel;
+ private readonly KryptonLinkWrapLabel _linkWrapLabel;
#endregion
#region Identity
@@ -36,6 +37,17 @@ public PaletteWrapLabel(KryptonWrapLabel wrapLabel)
_textColor = Color.Empty;
_hint = PaletteTextHint.Inherit;
}
+
+ /// Initializes a new instance of the class.
+ /// The link wrap label.
+ public PaletteWrapLabel(KryptonLinkWrapLabel linkWrapLabel)
+ {
+ _linkWrapLabel = linkWrapLabel;
+ _font = null;
+ _textColor = Color.Empty;
+ _hint = PaletteTextHint.Inherit;
+ }
+
#endregion
#region IsDefault
diff --git a/Source/Krypton Components/Krypton.Toolkit/Utilities/GraphicsExtensions.cs b/Source/Krypton Components/Krypton.Toolkit/Utilities/GraphicsExtensions.cs
index aba6840d1..17c53da30 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Utilities/GraphicsExtensions.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Utilities/GraphicsExtensions.cs
@@ -85,11 +85,13 @@ public static Icon LoadIcon(IconType type, Size size)
/// The image to resize.
/// The size that you want to resize the image to.
/// The resized image.
- public static Bitmap ScaleImage(Image sourceImage, Size imageSize)
+ public static Bitmap ScaleImage(Image sourceImage, Size? imageSize)
{
- var destRect = new Rectangle(0, 0, imageSize.Width, imageSize.Height);
+ Size tmpSize = imageSize ?? new Size(16, 16);
- var destImage = new Bitmap(imageSize.Width, imageSize.Height);
+ var destRect = new Rectangle(0, 0, tmpSize.Width, tmpSize.Height);
+
+ var destImage = new Bitmap(tmpSize.Width, tmpSize.Height);
destImage.SetResolution(sourceImage.HorizontalResolution, sourceImage.VerticalResolution);
diff --git a/Source/Krypton Components/Krypton.Toolkit/Utilities/UACShieldIconSize.cs b/Source/Krypton Components/Krypton.Toolkit/Utilities/UACShieldIconSize.cs
new file mode 100644
index 000000000..02f1f283b
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Utilities/UACShieldIconSize.cs
@@ -0,0 +1,28 @@
+#region BSD License
+/*
+ *
+ * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Toolkit
+{
+ /// Defines the UAC shield image size for a .
+ public enum UACShieldIconSize
+ {
+ /// A custom image size.
+ Custom = 0,
+ /// The extra small image size (16 x 16).
+ ExtraSmall = 1,
+ /// The small image size (32 x 32).
+ Small = 2,
+ /// The medium image size (64 x 64).
+ Medium = 3,
+ /// The large image size (128 x 128).
+ Large = 4,
+ /// The extra large image size (256 x 256).
+ ExtraLarge = 5
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs b/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs
index 8a0317a5a..c340ac35a 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Values/ButtonValues.cs
@@ -234,7 +234,7 @@ public void ResetExtraText()
/// Create the storage for the image states.
///
/// Storage object.
- protected virtual ButtonImageStates CreateImageStates() => new ();
+ protected virtual ButtonImageStates CreateImageStates() => new();
#endregion
diff --git a/Source/Krypton Components/Krypton.Toolkit/Values/ShadowValues.cs b/Source/Krypton Components/Krypton.Toolkit/Values/ShadowValues.cs
index 868baa332..861f63a6d 100644
--- a/Source/Krypton Components/Krypton.Toolkit/Values/ShadowValues.cs
+++ b/Source/Krypton Components/Krypton.Toolkit/Values/ShadowValues.cs
@@ -20,7 +20,7 @@ namespace Krypton.Toolkit
public class ShadowValues : Storage
{
#region statics
- private static readonly Point _defaultOffset = new(5,5);
+ private static readonly Point _defaultOffset = new(5, 5);
private double _blurDistance;
private bool _enableShadows;
private Point _offset;
diff --git a/Source/Krypton Components/Krypton.Toolkit/Values/UACShieldValues.cs b/Source/Krypton Components/Krypton.Toolkit/Values/UACShieldValues.cs
new file mode 100644
index 000000000..941f0b0c3
--- /dev/null
+++ b/Source/Krypton Components/Krypton.Toolkit/Values/UACShieldValues.cs
@@ -0,0 +1,52 @@
+#region BSD License
+/*
+ *
+ * New BSD 3-Clause License (https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/LICENSE)
+ * Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV), et al. 2017 - 2023. All rights reserved.
+ *
+ */
+#endregion
+
+namespace Krypton.Toolkit
+{
+ public class UACShieldValues : ButtonValues
+ {
+ #region Instance Fields
+
+ private bool _useAsUACShieldButton;
+
+ private bool _useOSStyleImage;
+
+ private UACShieldIconSize _iconSize;
+
+ private Size _customImageSize;
+
+ #endregion
+
+ public override bool IsDefault =>
+ (UseAsUACShieldButton == false) &&
+ (UseOSStyleImage == false) &&
+ (ShieldIconSize == UACShieldIconSize.ExtraSmall) &&
+ (CustomImageSize == null);
+
+ #region Identity
+
+ public UACShieldValues(NeedPaintHandler needPaint) : base(needPaint)
+ {
+ }
+
+ #endregion
+
+ #region Public
+
+ public bool UseAsUACShieldButton { get => _useAsUACShieldButton; set => _useAsUACShieldButton = value; }
+
+ public bool UseOSStyleImage { get => _useOSStyleImage; set => _useOSStyleImage = value; }
+
+ public UACShieldIconSize ShieldIconSize { get => _iconSize; set => _iconSize = value; }
+
+ public Size CustomImageSize { get => _customImageSize; set => _customImageSize = value; }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Source/Krypton Components/TestForm/Form1.Designer.cs b/Source/Krypton Components/TestForm/Form1.Designer.cs
index ce6fc3114..116f94bbe 100644
--- a/Source/Krypton Components/TestForm/Form1.Designer.cs
+++ b/Source/Krypton Components/TestForm/Form1.Designer.cs
@@ -32,34 +32,38 @@ private void InitializeComponent()
this.kryptonListBox1 = new Krypton.Toolkit.KryptonListBox();
this.kryptonTextBox1 = new Krypton.Toolkit.KryptonTextBox();
this.textBox1 = new System.Windows.Forms.TextBox();
+ this.kryptonLabel1 = new Krypton.Toolkit.KryptonLabel();
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
this.kryptonPanel1.SuspendLayout();
this.SuspendLayout();
//
// kryptonPanel1
//
+ this.kryptonPanel1.Controls.Add(this.kryptonLabel1);
this.kryptonPanel1.Controls.Add(this.kryptonListBox1);
this.kryptonPanel1.Controls.Add(this.kryptonTextBox1);
this.kryptonPanel1.Controls.Add(this.textBox1);
this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
- this.kryptonPanel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+ this.kryptonPanel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.kryptonPanel1.Name = "kryptonPanel1";
- this.kryptonPanel1.Size = new System.Drawing.Size(800, 450);
+ this.kryptonPanel1.Size = new System.Drawing.Size(600, 366);
this.kryptonPanel1.TabIndex = 0;
//
// kryptonListBox1
//
- this.kryptonListBox1.Location = new System.Drawing.Point(270, 12);
+ this.kryptonListBox1.Location = new System.Drawing.Point(202, 10);
+ this.kryptonListBox1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.kryptonListBox1.Name = "kryptonListBox1";
- this.kryptonListBox1.Size = new System.Drawing.Size(518, 426);
+ this.kryptonListBox1.Size = new System.Drawing.Size(388, 346);
this.kryptonListBox1.TabIndex = 2;
//
// kryptonTextBox1
//
- this.kryptonTextBox1.Location = new System.Drawing.Point(77, 128);
+ this.kryptonTextBox1.Location = new System.Drawing.Point(58, 104);
+ this.kryptonTextBox1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.kryptonTextBox1.Name = "kryptonTextBox1";
- this.kryptonTextBox1.Size = new System.Drawing.Size(100, 27);
+ this.kryptonTextBox1.Size = new System.Drawing.Size(75, 23);
this.kryptonTextBox1.TabIndex = 1;
this.kryptonTextBox1.Text = "kryptonTextBox1";
this.kryptonTextBox1.Click += new System.EventHandler(this.kryptonTextBox1_Click);
@@ -75,9 +79,10 @@ private void InitializeComponent()
//
// textBox1
//
- this.textBox1.Location = new System.Drawing.Point(73, 60);
+ this.textBox1.Location = new System.Drawing.Point(55, 49);
+ this.textBox1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.textBox1.Name = "textBox1";
- this.textBox1.Size = new System.Drawing.Size(100, 22);
+ this.textBox1.Size = new System.Drawing.Size(76, 20);
this.textBox1.TabIndex = 0;
this.textBox1.Click += new System.EventHandler(this.textBox1_Click);
this.textBox1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.textBox1_MouseClick);
@@ -90,13 +95,22 @@ private void InitializeComponent()
this.textBox1.Validating += new System.ComponentModel.CancelEventHandler(this.textBox1_Validating);
this.textBox1.Validated += new System.EventHandler(this.textBox1_Validated);
//
+ // kryptonLabel1
+ //
+ this.kryptonLabel1.LabelStyle = Krypton.Toolkit.LabelStyle.NormalControl;
+ this.kryptonLabel1.Location = new System.Drawing.Point(58, 164);
+ this.kryptonLabel1.Name = "kryptonLabel1";
+ this.kryptonLabel1.Size = new System.Drawing.Size(88, 20);
+ this.kryptonLabel1.TabIndex = 3;
+ this.kryptonLabel1.Values.Text = "kryptonLabel1";
+ //
// Form1
//
- this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(800, 450);
+ this.ClientSize = new System.Drawing.Size(600, 366);
this.Controls.Add(this.kryptonPanel1);
- this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+ this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.Name = "Form1";
this.PaletteMode = Krypton.Toolkit.PaletteMode.Office2007BlackDarkMode;
this.Text = "Form1";
@@ -113,5 +127,6 @@ private void InitializeComponent()
private Krypton.Toolkit.KryptonTextBox kryptonTextBox1;
private System.Windows.Forms.TextBox textBox1;
private Krypton.Toolkit.KryptonListBox kryptonListBox1;
+ private Krypton.Toolkit.KryptonLabel kryptonLabel1;
}
}
\ No newline at end of file
diff --git a/Source/Krypton Components/TestForm/Form1.resx b/Source/Krypton Components/TestForm/Form1.resx
index f298a7be8..1af7de150 100644
--- a/Source/Krypton Components/TestForm/Form1.resx
+++ b/Source/Krypton Components/TestForm/Form1.resx
@@ -1,4 +1,64 @@
-
+
+
+