Support
Joined: 18 Jul 2005 Posts: 731
|
Posted: Fri Feb 06, 2009 6:10 am Post subject: HOWTO: Use ShellNotifyIcon in WPF applications |
|
|
From the 'Shell MegaPack.Net WPF' toolbox tab, double-click on the 'ShellNotifyIcon' component to place it on your WPF form; then use the following code in the Window.Loaded event:
[C#]
Code: | private void Window_Loaded(object sender, RoutedEventArgs e)
{
shellNotifyIcon1.ImageList.Add(new Bitmap("C:\\image.bmp"));
shellNotifyIcon1.HostWindow = this;
} |
[VB.Net]
Code: | Private Sub Window1_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded
ShellNotifyIcon1.ImageList.Add(new Bitmap("C:\image.bmp"))
ShellNotifyIcon1.HostWindow = Me
End Sub |
|
|