本文整理汇总了C#中System.Windows.Forms.NotifyIcon.ShowBalloonTip方法的典型用法代码示例。如果您正苦于以下问题:C# NotifyIcon.ShowBalloonTip方法的具体用法?C# NotifyIcon.ShowBalloonTip怎么用?C# NotifyIcon.ShowBalloonTip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.NotifyIcon
的用法示例。
在下文中一共展示了NotifyIcon.ShowBalloonTip方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckRegistryUpdate
internal static void CheckRegistryUpdate(int version, NotifyIcon notifyIcon)
{
notifyIcon.ShowBalloonTip(0,
"Locale Emulator V" + Application.ProductVersion,
"Checking for registry updates ...",
ToolTipIcon.Info);
string url = string.Format(@"http://service.watashi.me/le/registry.php?ver={0}&lang={1}",
version,
CultureInfo.CurrentUICulture.LCID);
try
{
var webFileUri = new Uri(url);
WebRequest webRequest = WebRequest.Create(webFileUri);
webRequest.Timeout = 10 * 1000;
WebResponse response = webRequest.GetResponse();
var xmlContent = new XmlDocument();
xmlContent.Load(response.GetResponseStream());
ProcessUpdate(xmlContent, notifyIcon);
}
catch (Exception ex)
{
notifyIcon.ShowBalloonTip(0,
"Locale Emulator V" + Application.ProductVersion,
"Error occurs when downloading new registry data: \r\n" + ex.Message,
ToolTipIcon.Error);
Thread.Sleep(5000);
notifyIcon.Visible = false;
Environment.Exit(0);
}
}
示例2: Main
public static void Main (string[] args)
{
Thread notifyThread = new Thread(
delegate()
{
ShowWindow(GetConsoleWindow(), 0);
ContextMenu menu = new ContextMenu();
MenuItem mnuExit = new MenuItem("Выход");
menu.MenuItems.Add(0, mnuExit);
icon = new NotifyIcon()
{
Icon = SlideSwitcherServer.Resources.logo,
ContextMenu = menu,
Text = "Slide Switcher Server",
};
mnuExit.Click += delegate {
icon.Dispose();
Application.Exit();
};
icon.Visible = true;
icon.ShowBalloonTip(4000, "Slide Switcher", "Server", ToolTipIcon.Info);
Application.Run();
}
);
notifyThread.Start();
Server(port);
}
示例3: btnLogin_Click
private void btnLogin_Click(object sender, EventArgs e)
{
string response = network.HttpPost("http://www.status3gaming.com/gmtool/", "user=" + txtUsername.Text + "&pass=" + txtPassword.Text);
if(response == "0"){
MessageBox.Show("Failed Login", "Response", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
else if (Regex.IsMatch(response, "[0-9A-Fa-f]{40}"))
{
Program.SetHash(response);
MessageBox.Show("Successfully Logged In", "Response", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
this.Visible = false;
//Create Context Menu for system tray.
sysTrayMenu = new ContextMenu();
sysTrayMenu.MenuItems.Add("Check for new tickets...", OnRefresh);
sysTrayMenu.MenuItems.Add("Quit", OnExit);
sysTrayIcon = new NotifyIcon();
sysTrayIcon.Text = "GM Tool";
sysTrayIcon.Icon = Properties.Resources.Tray;
// Add menu to tray icon and show it.
sysTrayIcon.ContextMenu = sysTrayMenu;
sysTrayIcon.Visible = true;
sysTrayIcon.BalloonTipClicked += new EventHandler(sysTrayIcon_BaloonTipClicked);
sysTrayIcon.ShowBalloonTip(5000, "GM Tool", "Tray Monitor Active", ToolTipIcon.None);
timer.Start();
}
}
示例4: Form1
public Form1()
{
InitializeComponent();
this.Text = "";
this.ControlBox = false;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Width = Properties.Resources.USB.Width;
this.Height = Properties.Resources.USB.Height;
this.BackgroundImage = Properties.Resources.USB;
this.TopMost = true;
this.ShowInTaskbar = false;
m_Icon = new NotifyIcon();
m_Icon.Icon = Properties.Resources.USB_Icon;
MenuItem[] items = new MenuItem[2];
items[1] = new MenuItem("Exit");
items[1].Click += new EventHandler(Exit);
items[0] = new MenuItem("About");
items[0].Click += new EventHandler(About);
m_Icon.ContextMenu = new ContextMenu(items);
m_Icon.Visible = true;
m_Icon.BalloonTipIcon = ToolTipIcon.Info;
m_Icon.BalloonTipText = "USB Watcher Watching";
m_Icon.ShowBalloonTip(2000);
m_Icon.Text = "USB Watcher";
SetWindowLong(this.Handle, -20, 0x80000 | 0x20);
SetLayeredWindowAttributes(this.Handle, 0, 175, 0x2);
}
示例5: MainWindow
public MainWindow()
{
InitializeComponent();
this.Visibility = Visibility.Hidden;
notifyicon = new NotifyIcon();
notifyicon.BalloonTipTitle = "ECG Collector";
notifyicon.BalloonTipText = "ECG Collector is now running ...";
notifyicon.Icon = new System.Drawing.Icon("logo.ico");
notifyicon.Visible = true;
notifyicon.ShowBalloonTip(2000);
MenuItem about = new MenuItem("About");
about.Click += new EventHandler(About_OnClick);
MenuItem exit = new MenuItem("Exit");
exit.Click += new EventHandler(Exit_OnClick);
MenuItem[] children = new MenuItem[] { about, exit };
notifyicon.ContextMenu = new ContextMenu(children);
serialportThread = new Thread(new ThreadStart(CheckSerialport));
serialportThread.Start();
connectThread = new Thread(new ThreadStart(BeginConnect));
connectThread.Start();
}
示例6: getAccountBalance
//get the current account balance for a given user
public string getAccountBalance(string username, string apiKey, ref NotifyIcon notifyIcon)
{
string accountBalance = "0.0";
try
{
if (String.IsNullOrEmpty(username))
return "";
WebClient client = new WebClient();
string urlFormat = "http://marketplace.envato.com/api/v1/" + username + "/" + apiKey + "/account.json";
Uri url = new Uri(string.Format(urlFormat));
string data = client.DownloadString(url);
using (JsonReader reader = new JsonReader(new StringReader(data)))
{
while (reader.Read())
{
//users++;
if ((string)reader.Value == "balance")
{
reader.Read();
accountBalance = (string)reader.Value;
}
}
reader.Close(); //close the reader object
}
}
catch (WebException webex)
{
notifyIcon.ShowBalloonTip(180000000, "EnvatoTracker error!", "Error querying the api - invalid api key maybe?\n\nError:"+webex, ToolTipIcon.None);
}
return accountBalance;
}
示例7: OnStartup
protected override bool OnStartup(StartupEventArgs e)
{
//XmlConfigurator.Configure();
_touchMouseEventManager.Init();
_icon = new NotifyIcon
{
Icon = Properties.Resources.mouse,
Visible = true
};
var contextMenuStrip = new ContextMenuStrip();
contextMenuStrip.Items.Add(new MiddleClickStripMenuItem(_touchConfiguration));
contextMenuStrip.Items.Add(new TouchOverStripMenuItem(_touchConfiguration));
contextMenuStrip.Items.Add(new LeftHandedStripMenuItem(_touchConfiguration));
contextMenuStrip.Items.Add(new HelpToolStripMenuItem());
contextMenuStrip.Items.Add(new ToolStripSeparator());
contextMenuStrip.Items.Add(new MouseMapStripMenuItem(_touchMouseEventManager));
contextMenuStrip.Items.Add(new TouchZoneConfigurationStripMenuItem(_touchMouseEventManager, _touchZoneProvider));
contextMenuStrip.Items.Add(new ToolStripSeparator());
contextMenuStrip.Items.Add(new ExitStripMenuItem(_icon));
//Published on November 23rd 2008 by Aston.
//Released under the Free Art (copyleft) license.
// Icon for Windows XP, Vista and 7.
_icon.ContextMenuStrip = contextMenuStrip;
_icon.ShowBalloonTip(5000, "Info", "Touch Mouse Mate has started", ToolTipIcon.Info);
_icon.Text = string.Format("Touch Mouse Mate {0}", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version);
Application.Run();
return false;
}
示例8: ShowNotification
static void ShowNotification(string text, string title)
{
var container = new Container();
var wait = new ManualResetEvent(false);
var trayicon = new NotifyIcon(container);
EventHandler done = null;
done = delegate {
wait.Set();
trayicon.BalloonTipClosed -= done;
trayicon.BalloonTipClicked -= done;
};
trayicon.BalloonTipClicked += done;
trayicon.BalloonTipClosed += done;
trayicon.BalloonTipTitle = title;
trayicon.BalloonTipText = text;
var exe = Environment.GetFolderPath(
Environment.SpecialFolder.ProgramFilesX86) +
@"\iTunes\iTunes.exe";
var icon = Icon.ExtractAssociatedIcon(exe);
trayicon.Icon = new Icon(icon, 16, 16);
trayicon.Visible = true;
trayicon.ShowBalloonTip(5000);
wait.WaitOne(10000);
trayicon.Visible = false;
trayicon.Dispose();
icon.Dispose();
container.Dispose();
}
示例9: SysTrayHandler
public SysTrayHandler()
{
InitializeComponent();
this.dh = new DataHandler();
this.TransparencyKey = Color.Turquoise;
this.BackColor = Color.Turquoise;
trayMenu = new ContextMenu();
trayMenu.MenuItems.Add("Quit Tristram App", onExit);
Icon theIcon = new Icon( System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("Tristram_Status.Resources.tristram_icon.ico") );
trayIcon = new NotifyIcon();
trayIcon.Text = "Tristram Status";
trayIcon.Icon = theIcon;
trayIcon.ContextMenu = trayMenu;
trayIcon.Visible = true;
trayIcon.ShowBalloonTip(5000, "Tristram status", "Application is now running", ToolTipIcon.Info);
Visible = true;
int x = Screen.PrimaryScreen.WorkingArea.Width - this.Width;
int y = Screen.PrimaryScreen.WorkingArea.Height - this.Height;
this.SetDesktopLocation(x, y);
// Animation timer
this.animator = new Timer();
this.animator.Interval = 20;
this.animator.Tick += animate;
}
示例10: ShowNotifyTip
public static void ShowNotifyTip(NotifyIcon notifyIcon, String NotifyTitle, String Message, ToolTipIcon TipIcon)
{
if (String.IsNullOrEmpty(Message))
{
Message = " ";
}
notifyIcon.ShowBalloonTip(300, NotifyTitle, Message, TipIcon);
}
示例11: Main
static void Main()
{
NotifyIcon icon = new NotifyIcon();
icon.Icon = new System.Drawing.Icon(System.Reflection.Assembly.GetExecutingAssembly().Location);
icon.Visible = true;
if (Properties.Settings.Default.dirPath == "" || Properties.Settings.Default.password == "" || Properties.Settings.Default.driveLetter == "") {
icon.ShowBalloonTip(
1000,
"Unable to open encrypted file",
"Please open this program normally and fill in the required information",
ToolTipIcon.Error
);
return;
}
if (System.IO.Directory.Exists(Properties.Settings.Default.driveLetter)) {
if (Setup.Mount()) {
icon.ShowBalloonTip(
1000,
"Successful!",
"You encrypted volume is now mounted",
ToolTipIcon.None);
} else {
icon.ShowBalloonTip(
1000,
"Failure",
"Your encrypted volume was unable to be mounted",
ToolTipIcon.Error);
}
} else {
if (Setup.UnMount()) {
icon.ShowBalloonTip(
1000,
"Successful!",
"You encrypted volume is now unmounted",
ToolTipIcon.None);
} else {
icon.ShowBalloonTip(
1000,
"Failure",
"Your encrypted volume was unable to be unmounted",
ToolTipIcon.Error);
}
}
}
示例12: showViaSystemTrayBalloon
public void showViaSystemTrayBalloon(String track, String artist)
{
NotifyIcon balloon = new NotifyIcon();
balloon.Icon = SystemIcons.Exclamation;
balloon.BalloonTipIcon = ToolTipIcon.Info;
balloon.BalloonTipTitle = "Spotify Song Changed";
balloon.BalloonTipText = getNotificationText(track, artist);
balloon.Visible = true;
balloon.ShowBalloonTip(3000);
}
示例13: Balloon
public void Balloon ()
{
NotifyIcon ni = new NotifyIcon ();
ni.Text = "NotifyIcon Text";
ni.BalloonTipTitle = "Balloon Tip Title";
ni.BalloonTipText = "Balloon Tip Text.";
ni.BalloonTipIcon = ToolTipIcon.None;
ni.Visible = true;
ni.ShowBalloonTip (1);
}
示例14: Show
public static void Show(TrayNotifierInfo trayNotifierInfo)
{
if ((trayNotifierInfo != null) && (trayNotifierInfo.TimeOut >= 0))
{
if (notifyIcon != null)
{
notifyIcon.Dispose();
}
NotifyIcon tempLocal0 = new NotifyIcon
{
Text = trayNotifierInfo.Text,
Icon = trayNotifierInfo.Icon,
BalloonTipIcon = trayNotifierInfo.TipIcon,
BalloonTipText = trayNotifierInfo.TipText,
BalloonTipTitle = trayNotifierInfo.TipTitle,
ContextMenuStrip = CreateContextMenu(trayNotifierInfo.MenuItems)
};
notifyIcon = tempLocal0;
EventHandler showFormClick = delegate
{
if (trayNotifierInfo.Source != null)
{
MainForm.ShowInstance(trayNotifierInfo.Source);
}
else
{
MainForm.ShowInstance();
}
notifyIcon.Dispose();
};
notifyIcon.BalloonTipClicked += showFormClick;
notifyIcon.DoubleClick += showFormClick;
notifyIcon.Click += showFormClick;
notifyIcon.Visible = true;
if (trayNotifierInfo.ShowBalloonTip)
{
notifyIcon.ShowBalloonTip(trayNotifierInfo.TimeOut * 0x3e8);
}
if (trayNotifierInfo.TimeOut > 0)
{
Timer tempLocal1 = new Timer
{
Interval = trayNotifierInfo.TimeOut * 0x3e8
};
timer = tempLocal1;
timer.Tick += delegate
{
notifyIcon.Dispose();
timer.Stop();
};
timer.Start();
}
}
}
示例15: AppContext
public AppContext()
{
trayIcon = new NotifyIcon()
{
Icon = Properties.Resources.ycicon, ContextMenu = new ContextMenu(new MenuItem[]
{
new MenuItem("Show", Show),
new MenuItem("Exit", Exit)
}), Visible = true
};
trayIcon.ShowBalloonTip(2000, "YCNotify", "YCNotify is running in your system tray", ToolTipIcon.Info);
}