mirror of
https://github.com/ckaczor/wpf-notifyicon.git
synced 2026-02-09 01:32:41 -05:00
Allow to show balloon tips with large icons.
This commit is contained in:
@@ -776,7 +776,6 @@ namespace Hardcodet.Wpf.TaskbarNotification
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Displays a balloon tip with the specified title,
|
/// Displays a balloon tip with the specified title,
|
||||||
/// text, and a custom icon in the taskbar for the specified time period.
|
/// text, and a custom icon in the taskbar for the specified time period.
|
||||||
@@ -784,15 +783,21 @@ namespace Hardcodet.Wpf.TaskbarNotification
|
|||||||
/// <param name="title">The title to display on the balloon tip.</param>
|
/// <param name="title">The title to display on the balloon tip.</param>
|
||||||
/// <param name="message">The text to display on the balloon tip.</param>
|
/// <param name="message">The text to display on the balloon tip.</param>
|
||||||
/// <param name="customIcon">A custom icon.</param>
|
/// <param name="customIcon">A custom icon.</param>
|
||||||
|
/// <param name="largeIcon">True to allow large icons (Windows Vista and later).</param>
|
||||||
/// <exception cref="ArgumentNullException">If <paramref name="customIcon"/>
|
/// <exception cref="ArgumentNullException">If <paramref name="customIcon"/>
|
||||||
/// is a null reference.</exception>
|
/// is a null reference.</exception>
|
||||||
public void ShowBalloonTip(string title, string message, Icon customIcon)
|
public void ShowBalloonTip(string title, string message, Icon customIcon, bool largeIcon = false)
|
||||||
{
|
{
|
||||||
if (customIcon == null) throw new ArgumentNullException("customIcon");
|
if (customIcon == null) throw new ArgumentNullException("customIcon");
|
||||||
|
|
||||||
lock (this)
|
lock (this)
|
||||||
{
|
{
|
||||||
ShowBalloonTip(title, message, BalloonFlags.User, customIcon.Handle);
|
var flags = BalloonFlags.User;
|
||||||
|
|
||||||
|
if (largeIcon)
|
||||||
|
flags |= BalloonFlags.LargeIcon;
|
||||||
|
|
||||||
|
ShowBalloonTip(title, message, flags, customIcon.Handle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user