本文整理汇总了C#中System.Windows.Forms.NotifyIcon.ShowBalloonTip方法的典型用法代码示例。如果您正苦于以下问题:C# System.Windows.Forms.NotifyIcon.ShowBalloonTip方法的具体用法?C# System.Windows.Forms.NotifyIcon.ShowBalloonTip怎么用?C# System.Windows.Forms.NotifyIcon.ShowBalloonTip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.NotifyIcon
的用法示例。
在下文中一共展示了System.Windows.Forms.NotifyIcon.ShowBalloonTip方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ServerWindow
public ServerWindow()
{
InitializeComponent();
Closing += ServerWindow_Closing;
isConfigured = false;
isConnected = false;
isServerActive = false;
passwordChanged = false;
notifyServer = new System.Windows.Forms.NotifyIcon();
notifyServer.MouseClick += new System.Windows.Forms.MouseEventHandler(notifyServer_mouseClickEvent);
notifyServer.MouseMove += new System.Windows.Forms.MouseEventHandler(notifyServer_MouseMove);
path = Directory.GetCurrentDirectory().Remove(Directory.GetCurrentDirectory().Length - 9);
notifyServer.Icon = new System.Drawing.Icon(path + "\\Punto_rosso.ico");
status = new StatusWindow(this);
this.WindowState = WindowState.Normal;
this.ShowInTaskbar = true; //cosi non compare l'icona
notifyServer.Visible = true;
notifyServer.BalloonTipTitle = "Server AVVIATO";
notifyServer.BalloonTipText = "Caricate le impostazioni di default\nPremi START per mettere il server in attesa di connessioni";
notifyServer.ShowBalloonTip(300);
connectionParameter = new ConnectionParameter();
dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
//questo metodo mi serve per inserire tutti gli indirizzi presente sulla macchina server
caricaInfoIndirizzoServer();
caricaInfoTextBox();
stopButton.IsEnabled = false;
stateLabel.Content = NON_CONNESSO;
contHour = 0;
contMin = 0;
contSec = 0;
}
示例2: ShowNotification
public void ShowNotification(String message)
{
var notification = new System.Windows.Forms.NotifyIcon()
{
Visible = true,
Icon = System.Drawing.SystemIcons.Information,
BalloonTipText = message,
};
notification.ShowBalloonTip(60);
}
示例3: CreateIcon
private System.Windows.Forms.NotifyIcon CreateIcon()
{
icon = new System.Windows.Forms.NotifyIcon();
icon.Visible = true;
icon.Icon = new System.Drawing.Icon("small-orange-sphere.ico");
icon.ContextMenu = GetContextMenu();
icon.ShowBalloonTip(3, "BeCharming", "Ready to receive shared items...", System.Windows.Forms.ToolTipIcon.Info);
return icon;
}
示例4: InitialTray
private void InitialTray()
{
//设置托盘的各个属性
notifyIcon = new System.Windows.Forms.NotifyIcon();
notifyIcon.BalloonTipText = "程序开始运行";
string s = "OfficeScan (Online)\r\nAntivirus \r\nDCS Eng/Ptn:7.0.1028/1268";
notifyIcon.Text = s;
notifyIcon.Icon = new System.Drawing.Icon("favicon2.ico");
notifyIcon.Visible = true;
notifyIcon.ShowBalloonTip(1000);
notifyIcon.MouseClick += new System.Windows.Forms.MouseEventHandler(notifyIcon_MouseClick);
//设置菜单项
System.Windows.Forms.MenuItem[] menuitems =
{
new System.Windows.Forms.MenuItem("OfficeScan Console"),
new System.Windows.Forms.MenuItem("-"),
new System.Windows.Forms.MenuItem("Component Versions"),
new System.Windows.Forms.MenuItem("Update Now"),
new System.Windows.Forms.MenuItem("-"),
new System.Windows.Forms.MenuItem("Enable Roaming Mode"),
new System.Windows.Forms.MenuItem("-"),
new System.Windows.Forms.MenuItem("Scheduled Scan Advanced Settings"),
new System.Windows.Forms.MenuItem("-"),
new System.Windows.Forms.MenuItem("Plug-in Manager"),
new System.Windows.Forms.MenuItem("-"),
new System.Windows.Forms.MenuItem("Unload OfficeScan")
};
System.Windows.Forms.MenuItem menu1 = new System.Windows.Forms.MenuItem("OfficeScan Console");
System.Windows.Forms.MenuItem menu2 = new System.Windows.Forms.MenuItem("菜单项2");
//分隔线!!
System.Windows.Forms.MenuItem menu3 = new System.Windows.Forms.MenuItem("-");
////退出菜单项
//System.Windows.Forms.MenuItem exit = new System.Windows.Forms.MenuItem("exit");
//exit.Click += new EventHandler(exit_Click);
//关联托盘控件
System.Windows.Forms.MenuItem[] childen = menuitems;
notifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu(childen);
//窗体状态改变时候触发
this.StateChanged += new EventHandler(SysTray_StateChanged);
}
示例5: initNotifyIcon
private void initNotifyIcon()
{
notifyIcon = new System.Windows.Forms.NotifyIcon();
notifyIcon.BalloonTipText = "Brilliantech Warehouse Print Serivce";
notifyIcon.Text = "Brilliantech Warehouse Print Serivce";
string path = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "i.ico");
notifyIcon.Icon = new System.Drawing.Icon(path);
notifyIcon.Visible = true;
notifyIcon.ShowBalloonTip(2000);
notifyIcon.MouseClick += new System.Windows.Forms.MouseEventHandler(notifyIcon_MouseClick);
System.Windows.Forms.MenuItem item1 = new System.Windows.Forms.MenuItem("Menu 1");
System.Windows.Forms.MenuItem exit = new System.Windows.Forms.MenuItem("退出");
exit.Click += new EventHandler(exit_Click);
System.Windows.Forms.MenuItem[] menus = new System.Windows.Forms.MenuItem[] { exit };
notifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu(menus);
this.StateChanged += new EventHandler(MainWindow_StateChanged);
}
示例6: initNotifyIcon
private void initNotifyIcon()
{
ZigBeeIdLab.Content = SerialPortConfig.ZigBeeId;
ServicePortLab.Content = SerialPortConfig.ServicePort;
notifyIcon = new System.Windows.Forms.NotifyIcon();
notifyIcon.BalloonTipText = "BW LED " + SerialPortConfig.ZigBeeId + "(" + SerialPortConfig.ServicePort + ") Serivce";
notifyIcon.Text = "BW LED " + SerialPortConfig.ZigBeeId + "(" + SerialPortConfig.ServicePort + ") LED Serivce";
string path = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "i.ico");
notifyIcon.Icon = new System.Drawing.Icon(path);
notifyIcon.Visible = true;
notifyIcon.ShowBalloonTip(2000);
notifyIcon.MouseClick += new System.Windows.Forms.MouseEventHandler(notifyIcon_MouseClick);
System.Windows.Forms.MenuItem item1 = new System.Windows.Forms.MenuItem("Menu 1");
System.Windows.Forms.MenuItem exit = new System.Windows.Forms.MenuItem("退出");
exit.Click += new EventHandler(exit_Click);
System.Windows.Forms.MenuItem[] menus = new System.Windows.Forms.MenuItem[] { exit };
notifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu(menus);
this.StateChanged += new EventHandler(MainWindow_StateChanged);
}
示例7: SetupTrayIcon
private static void SetupTrayIcon(string logFileName)
{
// Create tray icon
var components = new System.ComponentModel.Container();
var notifyIcon = new System.Windows.Forms.NotifyIcon(components);
notifyIcon.Text = "Paradox Connection Router";
notifyIcon.Icon = Properties.Resources.Logo;
notifyIcon.Visible = true;
notifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu();
if (!string.IsNullOrEmpty(logFileName))
{
var showLogMenuItem = new System.Windows.Forms.MenuItem("Show &Log");
showLogMenuItem.Click += (sender, args) => OnShowLogClick(logFileName);
notifyIcon.ContextMenu.MenuItems.Add(showLogMenuItem);
notifyIcon.BalloonTipClicked += (sender, args) => OnShowLogClick(logFileName);
}
var openConsoleMenuItem = new System.Windows.Forms.MenuItem("Open Console");
openConsoleMenuItem.Click += (sender, args) => OnOpenConsoleClick((System.Windows.Forms.MenuItem)sender);
notifyIcon.ContextMenu.MenuItems.Add(openConsoleMenuItem);
var exitMenuItem = new System.Windows.Forms.MenuItem("E&xit");
exitMenuItem.Click += (sender, args) => OnExitClick();
notifyIcon.ContextMenu.MenuItems.Add(exitMenuItem);
GlobalLogger.GlobalMessageLogged += (logMessage) =>
{
System.Windows.Forms.ToolTipIcon toolTipIcon;
switch (logMessage.Type)
{
case LogMessageType.Debug:
case LogMessageType.Verbose:
case LogMessageType.Info:
toolTipIcon = System.Windows.Forms.ToolTipIcon.Info;
break;
case LogMessageType.Warning:
toolTipIcon = System.Windows.Forms.ToolTipIcon.Warning;
break;
case LogMessageType.Error:
case LogMessageType.Fatal:
toolTipIcon = System.Windows.Forms.ToolTipIcon.Error;
break;
default:
throw new ArgumentOutOfRangeException();
}
// Display notification (for one second)
notifyIcon.ShowBalloonTip(2000, "Paradox Connection Router", logMessage.ToString(), toolTipIcon);
};
System.Windows.Forms.Application.ApplicationExit += (sender, e) =>
{
notifyIcon.Visible = false;
notifyIcon.Icon = null;
notifyIcon.Dispose();
};
}
示例8: CreateNotifyIcon
private void CreateNotifyIcon()
{
//create menu
var main = new System.Windows.Forms.ContextMenu();
var restore = new System.Windows.Forms.MenuItem
{
Text = "Show Interface..."
};
restore.Click += new EventHandler(restore_Click);
main.MenuItems.Add(restore);
var refresh = new System.Windows.Forms.MenuItem
{
Name = "refresh",
Text = "Refresh Now"
};
refresh.Click += new EventHandler(refresh_Click);
main.MenuItems.Add(refresh);
var tipOption = new System.Windows.Forms.MenuItem
{
Text = _config.ShowBalloonTip ? "Disable Balloon" : "Enable Balloon"
};
tipOption.Click += new EventHandler(notifyIcon_BalloonTipClicked);
main.MenuItems.Add(tipOption);
var configureOption = new System.Windows.Forms.MenuItem
{
Name = "configure",
Text = "Configure Media Browser..."
};
configureOption.Click += new EventHandler(configure_Click);
main.MenuItems.Add(configureOption);
var sep = new System.Windows.Forms.MenuItem
{
Text = "-"
};
main.MenuItems.Add(sep);
var exit = new System.Windows.Forms.MenuItem
{
Name = "exit",
Text = "Exit"
};
exit.Click += new EventHandler(exit_Click);
main.MenuItems.Add(exit);
//set up our systray icon
Stream iconStream = Application.GetResourceStream(new Uri("pack://application:,,,/MediaBrowserService;component/MBService.ico")).Stream;
notifyIcon = new System.Windows.Forms.NotifyIcon
{
BalloonTipTitle = "Media Browser Service",
BalloonTipText = "Running in background. Use tray icon to configure...",
Text = "Media Browser Service",
Icon = new System.Drawing.Icon(iconStream),
ContextMenu = main,
Visible = true
};
notifyIcon.DoubleClick += notifyIcon_Click;
notifyIcon.BalloonTipClicked += new EventHandler(notifyIcon_BalloonTipClicked);
if (_config.ShowBalloonTip) notifyIcon.ShowBalloonTip(2000);
//create our refresh icons
iconStream = Application.GetResourceStream(new Uri("pack://application:,,,/MediaBrowserService;component/MBServiceRefresh.ico")).Stream;
RefreshIcons[0] = new System.Drawing.Icon(iconStream);
iconStream = Application.GetResourceStream(new Uri("pack://application:,,,/MediaBrowserService;component/MBServiceRefresh2.ico")).Stream;
RefreshIcons[1] = new System.Drawing.Icon(iconStream);
}
示例9: loadNotifyIcon
private void loadNotifyIcon(string cliente)
{
notifyIcon = new System.Windows.Forms.NotifyIcon();
notifyIcon.Icon = System.Drawing.Icon.FromHandle(Properties.Resources.information.GetHicon());
notifyIcon.BalloonTipText = cliente + " ha pernottato " + Properties.Settings.Default.CadenzaPremioSoggiorni + " volte alla Fattoria Pianetti!"; // Text of BalloonTip
notifyIcon.Text = "Premio cliente raggiunto"; // ToolTip of NotifyIcon
notifyIcon.BalloonTipTitle = "Cliente ha raggiunto il premio soggiorni";
notifyIcon.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info;
notifyIcon.Visible = true;
notifyIcon.Text = "Premio cliente";
notifyIcon.ShowBalloonTip(1000); // Shows BalloonTip
notifyIcon.Click += new System.EventHandler(NotifyIcon_Click);
}
示例10: InitSysTray
private void InitSysTray()
{
var rs = Application.GetResourceStream(new Uri("pack://application:,,,/search.ico"));
var ni = new System.Windows.Forms.NotifyIcon();
ni.Icon = new System.Drawing.Icon(rs.Stream);
ni.Visible = true;
ni.DoubleClick +=
delegate (object sender, EventArgs args)
{
this.Show();
this.WindowState = WindowState.Normal;
};
ni.Text = "HyperSearch - Double click to open log";
var ctx = new System.Windows.Forms.ContextMenu();
ctx.MenuItems.Add(new System.Windows.Forms.MenuItem("View log", (ss, ee) => { this.Show(); this.WindowState = System.Windows.WindowState.Normal; }));
ctx.MenuItems.Add(new System.Windows.Forms.MenuItem("Exit", (ss, ee) => { Application.Current.Shutdown(); }));
ni.ContextMenu = ctx;
int balloonToolTipTimeoutInsMS = HyperSearchSettings.Instance().General.BalloonToolTipTimeOutInMilliseconds;
if (balloonToolTipTimeoutInsMS > 0)
{
ni.ShowBalloonTip(balloonToolTipTimeoutInsMS, "HyperSearch started", "Double click tray icon to bring up log window.", System.Windows.Forms.ToolTipIcon.Info);
}
}
示例11: SetupTrayIcon
private static void SetupTrayIcon(string logFileName)
{
// Create tray icon
var components = new System.ComponentModel.Container();
var notifyIcon = new System.Windows.Forms.NotifyIcon(components);
notifyIcon.Text = "Xenko Connection Router";
notifyIcon.Icon = Properties.Resources.Logo;
notifyIcon.Visible = true;
notifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu();
if (!string.IsNullOrEmpty(logFileName))
{
var showLogMenuItem = new System.Windows.Forms.MenuItem("Show &Log");
showLogMenuItem.Click += (sender, args) => OnShowLogClick(logFileName);
notifyIcon.ContextMenu.MenuItems.Add(showLogMenuItem);
notifyIcon.BalloonTipClicked += (sender, args) => OnShowLogClick(logFileName);
}
var openConsoleMenuItem = new System.Windows.Forms.MenuItem("Open Console");
openConsoleMenuItem.Click += (sender, args) => OnOpenConsoleClick((System.Windows.Forms.MenuItem)sender);
notifyIcon.ContextMenu.MenuItems.Add(openConsoleMenuItem);
var exitMenuItem = new System.Windows.Forms.MenuItem("E&xit");
exitMenuItem.Click += (sender, args) => OnExitClick();
notifyIcon.ContextMenu.MenuItems.Add(exitMenuItem);
GlobalLogger.GlobalMessageLogged += (logMessage) =>
{
// Log only warning, errors and more
if (logMessage.Type < LogMessageType.Warning)
return;
var toolTipIcon = logMessage.Type < LogMessageType.Error ? System.Windows.Forms.ToolTipIcon.Warning : System.Windows.Forms.ToolTipIcon.Error;
// Display notification (for two second)
notifyIcon.ShowBalloonTip(2000, "Xenko Connection Router", logMessage.ToString(), toolTipIcon);
};
System.Windows.Forms.Application.ApplicationExit += (sender, e) =>
{
notifyIcon.Visible = false;
notifyIcon.Icon = null;
notifyIcon.Dispose();
};
}
示例12: Window_Loaded
private void Window_Loaded(object sender, RoutedEventArgs e)
{
_this = this;
notifyIcon = new System.Windows.Forms.NotifyIcon();
notifyIcon.BalloonTipText = "程序开始运行";
notifyIcon.BalloonTipTitle = "NewsApp";
notifyIcon.Text = "NewsApp Tray";
notifyIcon.Icon = System.Drawing.SystemIcons.WinLogo;
notifyIcon.Visible = true;
notifyIcon.ShowBalloonTip(1000);
notifyIcon.MouseClick += new System.Windows.Forms.MouseEventHandler(notifyIcon_MouseClick);
notifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu(new System.Windows.Forms.MenuItem[]
{
new System.Windows.Forms.MenuItem("关于", (obj, args) =>
System.Windows.MessageBox.Show(this, "NewsApp by bajdcc", "NewsApp")),
new System.Windows.Forms.MenuItem("-"),
new System.Windows.Forms.MenuItem("显示主界面", (obj, args) =>
Show()),
new System.Windows.Forms.MenuItem("隐藏主界面", (obj, args) =>
Hide()),
new System.Windows.Forms.MenuItem("-"),
new System.Windows.Forms.MenuItem("显示新闻", (obj, args) =>
{
if (_newsMachine != null && _newsMachine.Overlay != null)
{
_newsMachine.Overlay.Show();
}
}),
new System.Windows.Forms.MenuItem("隐藏新闻", (obj, args) =>
{
if (_newsMachine != null && _newsMachine.Overlay != null)
{
_newsMachine.Overlay.Hide();
}
}),
new System.Windows.Forms.MenuItem("关闭新闻", (obj, args) =>
{
if (_newsMachine != null && _newsMachine.Overlay != null)
{
_newsMachine.Cancel(true);
}
}),
new System.Windows.Forms.MenuItem("背景透明", (obj, args) =>
{
NewsMachine.Settings.TransparentBackground = !NewsMachine.Settings.TransparentBackground;
var _this = obj as System.Windows.Forms.MenuItem;
_this.Checked = !_this.Checked;
if (_newsMachine != null && _newsMachine.Overlay != null)
{
_newsMachine.Cancel(true);
}
})
{
Checked = false
},
new System.Windows.Forms.MenuItem("鼠标穿透", (obj, args) =>
{
NewsMachine.Settings.TransparentWindow = !NewsMachine.Settings.TransparentWindow;
var _this = obj as System.Windows.Forms.MenuItem;
_this.Checked = !_this.Checked;
if (_newsMachine != null && _newsMachine.Overlay != null)
{
_newsMachine.Cancel(true);
}
})
{
Checked = true
},
new System.Windows.Forms.MenuItem("-"),
new System.Windows.Forms.MenuItem("手动刷新", (obj, args) =>
{
if (_newsMachine != null)
{
_newsMachine.Reset();
}
}),
new System.Windows.Forms.MenuItem("-"),
new System.Windows.Forms.MenuItem("退出", (obj, args) =>
AnimateClose())
});
_newsMachine = new NewsMachine();
_newsMachine.OnLogging += TraceOutput;
_newsMachine.MainDispatcher = Dispatcher;
_newsMachine.Start();
}