mirror of https://github.com/dahall/Vanara.git
Added SetTheme method with VisualStyleElement as parameter.
parent
687d01e099
commit
ed841151fe
|
@ -143,6 +143,10 @@ namespace Vanara.Windows.Forms
|
||||||
ResetTheme();
|
ResetTheme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>Sets the theme using <see cref="System.Windows.Forms.VisualStyles.VisualStyleElement"/> information.</summary>
|
||||||
|
/// <param name="visualStyle">The visual style.</param>
|
||||||
|
public void SetTheme(System.Windows.Forms.VisualStyles.VisualStyleElement visualStyle) => SetTheme(visualStyle?.ClassName, visualStyle?.Part ?? 0, visualStyle?.State ?? 0);
|
||||||
|
|
||||||
internal static Rectangle DeflateRect(Rectangle rect, Padding padding)
|
internal static Rectangle DeflateRect(Rectangle rect, Padding padding)
|
||||||
{
|
{
|
||||||
rect.X += padding.Left;
|
rect.X += padding.Left;
|
||||||
|
|
|
@ -94,6 +94,10 @@ namespace Vanara.Windows.Forms
|
||||||
ResetTheme();
|
ResetTheme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>Sets the theme using <see cref="VisualStyleElement"/> information.</summary>
|
||||||
|
/// <param name="visualStyle">The visual style.</param>
|
||||||
|
public void SetTheme(VisualStyleElement visualStyle) => SetTheme(visualStyle?.ClassName, visualStyle?.Part ?? 0, visualStyle?.State ?? 0);
|
||||||
|
|
||||||
/// <summary>Raises the <see cref="Control.Paint"/> event.</summary>
|
/// <summary>Raises the <see cref="Control.Paint"/> event.</summary>
|
||||||
/// <param name="e">A <see cref="PaintEventArgs"/> that contains the event data.</param>
|
/// <param name="e">A <see cref="PaintEventArgs"/> that contains the event data.</param>
|
||||||
protected override void OnPaint(PaintEventArgs e)
|
protected override void OnPaint(PaintEventArgs e)
|
||||||
|
|
|
@ -96,6 +96,10 @@ namespace Vanara.Windows.Forms
|
||||||
ResetTheme();
|
ResetTheme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>Sets the theme using <see cref="VisualStyleElement"/> information.</summary>
|
||||||
|
/// <param name="visualStyle">The visual style.</param>
|
||||||
|
public void SetTheme(VisualStyleElement visualStyle) => SetTheme(visualStyle?.ClassName, visualStyle?.Part ?? 0, visualStyle?.State ?? 0);
|
||||||
|
|
||||||
/// <summary>Raises the <see cref="Control.Paint"/> event.</summary>
|
/// <summary>Raises the <see cref="Control.Paint"/> event.</summary>
|
||||||
/// <param name="e">A <see cref="PaintEventArgs"/> that contains the event data.</param>
|
/// <param name="e">A <see cref="PaintEventArgs"/> that contains the event data.</param>
|
||||||
protected override void OnPaint(PaintEventArgs e)
|
protected override void OnPaint(PaintEventArgs e)
|
||||||
|
|
Loading…
Reference in New Issue