private void InitializeNotification() { this.notifyIcon = new NotifyIconEx(); this.notifyIcon.Text = "Print Details On Pallet Running"; this.notifyIcon.Icon = this.language.GetIcon("LLC_PartialPrint"); this.notifyIcon.Visible = true; //notifyIcon.ContextMenu = NotifyContextMenu; this.notifyIcon.DoubleClick += new EventHandler(notifyIcon_DoubleClick); }
private void InitializeNotification() { this.notifyIcon = new NotifyIconEx(); this.notifyIcon.Text = "FGTrack Running"; this.notifyIcon.Icon = base.Language.GetIcon("FG_Tracking"); this.notifyIcon.Visible = true; //notifyIcon.ContextMenu = NotifyContextMenu; this.notifyIcon.BalloonClick += new EventHandler(this.OnClickBalloon); }
public void Initialize() { // MainWindowのインスタンス取得 window = App.Current.MainWindow as MainWindow; // NotifyIconExのインスタンス生成 var iconPath = new Uri("pack://application:,,,/Resources/HIDUtilitiesIcon.ico", UriKind.RelativeOrAbsolute); var menu = window.FindResource("contextmenu") as System.Windows.Controls.ContextMenu; notify = new NotifyIconEx(iconPath, "HID Utilities", menu); notify.DoubleClick += (_, __) => ShowWindow(); // ウィンドウを非表示に window.Hide(); // キーフックの設定 setupKeyHook(); }
public Form1() { InitializeComponent(); this.pBoxRegistryState.Image = RepairTools_2._0.Properties.Resources.checknot; this.lblRegistryState.Text = "状态未检测"; this.btnGoFileDelete.Enabled = false; this.ultraProgressBar1.Maximum = 100; this.pboxAutorunFileState.Image = RepairTools_2._0.Properties.Resources.checknot; myIcon = new Icon("app.ico"); if (notifyIcon == null) { notifyIcon = new NotifyIconEx(); notifyIcon.Text = TipText; notifyIcon.Icon = this.myIcon; notifyIcon.Visible = true; notifyIcon.Click += new EventHandler(OnClickIcon); notifyIcon.BalloonClick += new EventHandler(OnClickBalloon); } MenuItem showMainForm = new MenuItem("显示主界面"); MenuItem close = new MenuItem("关闭程序"); MenuItem[] menuitems = { showMainForm, close }; notifyIcon.ContextMenu = new ContextMenu(menuitems); notifyIcon.ContextMenu.MenuItems[0].Click += new EventHandler(showMainFormMethod); notifyIcon.ContextMenu.MenuItems[1].Click += new EventHandler(closeMainFormMethod); foreach (string str in searchMethod.getDrivers()) { if (str != null) { comboBoxDrivers.Items.Add(str); } } driveDetector = new DriveDetector(this); driveDetector.DeviceArrived += new DriveDetectorEventHandler(OnRemovableDriveArrived); driveDetector.DeviceRemoved += new DriveDetectorEventHandler(removeRemovableDrive); }