Added SetTheme method with VisualStyleElement as parameter.

pull/83/head
David Hall 2019-09-02 17:08:12 -06:00
parent 687d01e099
commit ed841151fe
3 changed files with 12 additions and 0 deletions

View File

@ -143,6 +143,10 @@ namespace Vanara.Windows.Forms
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)
{
rect.X += padding.Left;

View File

@ -94,6 +94,10 @@ namespace Vanara.Windows.Forms
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>
/// <param name="e">A <see cref="PaintEventArgs"/> that contains the event data.</param>
protected override void OnPaint(PaintEventArgs e)

View File

@ -96,6 +96,10 @@ namespace Vanara.Windows.Forms
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>
/// <param name="e">A <see cref="PaintEventArgs"/> that contains the event data.</param>
protected override void OnPaint(PaintEventArgs e)