• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Forms.NotifyIcon类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Windows.Forms.NotifyIcon的典型用法代码示例。如果您正苦于以下问题:C# System.Windows.Forms.NotifyIcon类的具体用法?C# System.Windows.Forms.NotifyIcon怎么用?C# System.Windows.Forms.NotifyIcon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



System.Windows.Forms.NotifyIcon类属于命名空间,在下文中一共展示了System.Windows.Forms.NotifyIcon类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CreateNotificationIcon

        private void CreateNotificationIcon()
        {
            DestroyNotificationIcon();

            _notifyIcon = new System.Windows.Forms.NotifyIcon
            {
                BalloonTipTitle = Properties.Resources.NotifierTitle,
                Text = Properties.Resources.NotifierTitle
            };

            var stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("GoogleCalendarReminder.Resources.calendar.ico");
            if (stream != null)
            {
                _notifyIcon.Icon = new Icon(stream);
            }

            _notifyIcon.DoubleClick += NotifyIconClick;

            _notifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu();
            _notifyIcon.ContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("Refresh Calendars", OnRefresh));
            _notifyIcon.ContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("Upcoming Events...", OnUpcomingEvents));
            _notifyIcon.ContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("Settings...", new EventHandler(OnSettings)));
            _notifyIcon.ContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("-"));
            _notifyIcon.ContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("View Project Page...", OnLaunchProjectPage));
            _notifyIcon.ContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("View Issue Log...", OnViewLog));
            _notifyIcon.ContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("-"));
            _notifyIcon.ContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("About...", OnAbout));
            _notifyIcon.ContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("-"));
            _notifyIcon.ContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("Exit", OnExit));

            _notifyIcon.Visible = true;
        }
开发者ID:cyndilou,项目名称:CalendarReminderApp,代码行数:32,代码来源:NotificationService.cs


示例2: InitializeComponent

		/// <summary>
		/// This method is required for Windows Forms designer support.
		/// Do not change the method contents inside the source code editor. The Forms designer might
		/// not be able to load this method if it was changed manually.
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
			this.SuspendLayout();
			// 
			// notifyIcon1
			// 
			this.notifyIcon1.Icon = global::StickyNotesWall.Resource1.favicon;
			this.notifyIcon1.Text = "Ocean Notes\' Wall";
			this.notifyIcon1.Visible = true;
			this.notifyIcon1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.NotifyIcon1MouseClick);
			// 
			// StartingWindow
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.ClientSize = new System.Drawing.Size(314, 62);
			this.ControlBox = false;
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
			this.Icon = global::StickyNotesWall.Resource1.favicon;
			this.Name = "StartingWindow";
			this.ShowIcon = false;
			this.ShowInTaskbar = false;
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "StartingWindow";
			this.WindowState = System.Windows.Forms.FormWindowState.Minimized;
			this.ResumeLayout(false);

		}
开发者ID:SommerEngineering,项目名称:OceanNotesWall,代码行数:35,代码来源:StartingWindow.Designer.cs


示例3: TrayIcon

        public TrayIcon()
        {
            _trayIcon = new System.Windows.Forms.NotifyIcon();
            _trayIcon.ContextMenu = new System.Windows.Forms.ContextMenu();

            var aboutString = EarTrumpet.Properties.Resources.ContextMenuAboutTitle;
            var version = Assembly.GetEntryAssembly().GetName().Version;
            _trayIcon.ContextMenu.MenuItems.Add(String.Format("{0} Ear Trumpet {1} ...", aboutString, version));
            _trayIcon.ContextMenu.MenuItems[0].Click += About_Click;

            _trayIcon.ContextMenu.MenuItems.Add(EarTrumpet.Properties.Resources.ContextMenuShowDesktopAppsTitle);
            _trayIcon.ContextMenu.MenuItems[1].Checked = UserPreferencesService.ShowDesktopApps;
            _trayIcon.ContextMenu.MenuItems[1].Click += ShowDesktopApps_Click;
                
            _trayIcon.ContextMenu.MenuItems.Add("-");

            _trayIcon.ContextMenu.MenuItems.Add(EarTrumpet.Properties.Resources.ContextMenuExitTitle);
            _trayIcon.ContextMenu.MenuItems[3].Click += Exit_Click;

            _trayIcon.MouseClick += TrayIcon_MouseClick;
            _trayIcon.Icon = new System.Drawing.Icon(Application.GetResourceStream(new Uri("pack://application:,,,/EarTrumpet;component/Tray.ico")).Stream);

            var tooltipString = EarTrumpet.Properties.Resources.ContextMenuTooltip;
            _trayIcon.Text = String.Format("Ear Trumpet - {0}", tooltipString);
            _trayIcon.Visible = true;
        }
开发者ID:RemiGC,项目名称:EarTrumpet,代码行数:26,代码来源:TrayIcon.cs


示例4: Start

		public static void Start(EventHandler onShow, EventHandler onClose, EventHandler onShowLogs)
		{
			RefreshTaskbarNotificationArea();
			AppDomain.CurrentDomain.ProcessExit += new EventHandler(CurrentDomain_ProcessExit);
			_notifyIcon = new System.Windows.Forms.NotifyIcon();
			Stream iconStream = Application.GetResourceStream(new Uri("pack://application:,,,/ServerFS2;component/FS2.ico")).Stream;
			_notifyIcon.Icon = new System.Drawing.Icon(iconStream);
			_notifyIcon.Visible = true;

			_notifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu();
			var menuItem1 = new System.Windows.Forms.MenuItem();
			menuItem1.Text = "Показать";
			menuItem1.Click += new EventHandler(onShow);
			_notifyIcon.ContextMenu.MenuItems.Add(menuItem1);

			var menuItem2 = new System.Windows.Forms.MenuItem();
			menuItem2.Text = "Выход";
			menuItem2.Click += new EventHandler(onClose);
			_notifyIcon.ContextMenu.MenuItems.Add(menuItem2);

			var menuItem3 = new System.Windows.Forms.MenuItem();
			menuItem3.Text = "Логи";
			menuItem3.Click += new EventHandler(onShowLogs);
			_notifyIcon.ContextMenu.MenuItems.Add(menuItem3);

			_notifyIcon.Text = "Сервер FS2";
		}
开发者ID:saeednazari,项目名称:Rubezh,代码行数:27,代码来源:NotifyIconService.cs


示例5: 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;
 }
开发者ID:giu-fio,项目名称:remote-control-server,代码行数:31,代码来源:ServerWindow.xaml.cs


示例6: Main

        public Main()
        {
            InitializeComponent();

            System.Windows.Forms.ContextMenu systemTrayContextMenu = new System.Windows.Forms.ContextMenu();
            systemTrayContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("Reports", new EventHandler(Reports_Click)));
            systemTrayContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("Settings", new EventHandler(Settings_Click)));
            systemTrayContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("Exit", new EventHandler(Exit_Click)));

            SystemTrayIcon = new System.Windows.Forms.NotifyIcon();
            SystemTrayIcon.ContextMenu = systemTrayContextMenu;
            SystemTrayIcon.Visible = true;
            SystemTrayIcon.Icon = new Icon(SystemIcons.Application, 40, 40);
            SystemTrayIcon.Text = "Slacking off";
            SystemTrayIcon.BalloonTipTitle = "Get Back To Work";
            SystemTrayIcon.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info;
            SystemTrayIcon.Click += new EventHandler(SystemTrayIcon_Click);

            Hide();

            Left = System.Windows.SystemParameters.PrimaryScreenWidth - Width - 5;
            Top = 5;

            DateStarted = null;
            LoadSettings();
        }
开发者ID:colourblind,项目名称:GetBackToWork,代码行数:26,代码来源:Main.xaml.cs


示例7: MainWindow

        public MainWindow()
        {
            InitializeComponent();

            System.Windows.Forms.NotifyIcon ni = new System.Windows.Forms.NotifyIcon();

            System.IO.Stream iconStream = Application.GetResourceStream(new Uri("pack://application:,,,/Icons/App.ico")).Stream;
            ni.Icon = new System.Drawing.Icon(iconStream);

            ni.Visible = true;
            ni.DoubleClick +=
                delegate (object sender, EventArgs args)
                {
                    Show();
                    WindowState = WindowState.Normal;
                };

            // and hide
            Hide();

            // register to run at startup
            RegistryKey rkApp = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
            if (rkApp.GetValue("MachMultimediaKeysMapper") == null)
            {
                rkApp.SetValue("MachMultimediaKeysMapper", System.Reflection.Assembly.GetExecutingAssembly().Location);
            }
        }
开发者ID:machv,项目名称:multimedia-keys-mapper,代码行数:27,代码来源:MainWindow.xaml.cs


示例8: MainWindow

        public MainWindow()
        {
            InitializeComponent();

            _myNotifyIcon = new System.Windows.Forms.NotifyIcon {Icon = new System.Drawing.Icon("rss.ico")};
            _myNotifyIcon.MouseDoubleClick += (a, b) => WindowState = WindowState.Normal;
            _myNotifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu(
                new[]
                {
                    new MenuItem("Open", (a, b) => WindowState = WindowState.Normal),
                    new MenuItem("-"),
                    new MenuItem(
                        "Exit",
                        (a, b) =>
                        {
                            _myNotifyIcon.Visible = false;
                            Close();
                        })
                });

            PopulateQualities();

            _localIp = Dns.GetHostEntry(Dns.GetHostName()).
                AddressList.First(ip => ip.AddressFamily == AddressFamily.InterNetwork).ToString();

            var address = Settings.Default.OverrideNetworkSettings ? Settings.Default.HostName : _localIp;
            var port = Settings.Default.OverrideNetworkSettings ? Settings.Default.PortNumber : DefaultPort;
            IpAddressLabel.Text = address;
            PortLabel.Text = port;
            _baseAddress = string.Format(_baseAddress, address, port);

            Generate.Content = "Generate & Copy URL";
        }
开发者ID:jamesqo,项目名称:YouCast,代码行数:33,代码来源:MainWindow.xaml.cs


示例9: MainWindow

        public MainWindow()
        {
            InitializeComponent();

            this.IsPostPanelExpand = true;
            this.IsFunctionPanelExpand = true;
            this.IsMessagePostPanelExpand = true;

            this.AuthPanel.OkButton.Click += new RoutedEventHandler(OkButton_Click);
            this.AuthPanel.PrevButton.Click += new RoutedEventHandler(PrevButton_Click);
            this.AuthPanel.NextButton.Click += new RoutedEventHandler(NextButton_Click);

            this.ReplyPanel.ReplyButton.Click += new RoutedEventHandler(ReplyPanelReplyButton_Click);
            this.ReplyPanel.CancelButton.Click += new RoutedEventHandler(ReplyPanelCancelButton_Click);

            #region Task Tray
            int ScreenWidth = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width;
            int Screenheigth = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height;
            int AppWidth = (int)this.Width;
            int AppHeight = (int)this.Height;
            Canvas.SetLeft(this, ScreenWidth - AppWidth);  //ScreenWidth / 2 - AppWidth / 2;
            Canvas.SetTop(this, Screenheigth - AppHeight); //Screenheigth / 2 - AppHeight / 2;
            this.StateChanged += new EventHandler(MainWindow_StateChanged);
            this.taskIcon = new System.Windows.Forms.NotifyIcon();
            this.taskIcon.Visible = true;
            this.taskIcon.Icon = Properties.Resources.YammyyIcon;
            this.taskIcon.MouseClick += new System.Windows.Forms.MouseEventHandler(taskIcon_MouseClick);
            this.taskIcon.ContextMenu = new System.Windows.Forms.ContextMenu();
            System.Windows.Forms.MenuItem item = new System.Windows.Forms.MenuItem("&Exit", taskIconItemExit_Click);
            this.taskIcon.ContextMenu.MenuItems.Add(item);
            #endregion

            System.Threading.Thread th = new System.Threading.Thread(new System.Threading.ThreadStart(InitialCheck));
            th.Start();
        }
开发者ID:changman,项目名称:yammyy,代码行数:35,代码来源:MainWindow.xaml.cs


示例10: LogAndErrorsUtils

 public LogAndErrorsUtils(System.Windows.Forms.NotifyIcon notifyIcon, System.Windows.Forms.ToolTipIcon tooltypeIcon)
 {
     m_logger = LogManager.GetCurrentClassLogger();
     m_notifyIcon = notifyIcon;
     m_tooltypeIcon = tooltypeIcon;
     m_bFirstError = false;
 }
开发者ID:ignazio-castrogiovanni,项目名称:OCR_AD,代码行数:7,代码来源:LogAndErrorsUtils.cs


示例11: Main

        public Main()
        {
            InitializeComponent();
            if (isDebug.Equals("false"))
                this.Topmost = true;

            this.notifyIcon = new System.Windows.Forms.NotifyIcon();
            this.notifyIcon.BalloonTipText = "多电站演示系统正在运行!";
            this.notifyIcon.Text = "多电站演示系统!";
            this.notifyIcon.Icon = new System.Drawing.Icon("favicon.ico");
            this.notifyIcon.Visible = true;
            this.notifyIcon.ShowBalloonTip(1000);
            this.notifyIcon.MouseClick += new System.Windows.Forms.MouseEventHandler(notifyIcon_MouseClick);

            System.Windows.Forms.MenuItem showWindow = new System.Windows.Forms.MenuItem("显示界面");
            showWindow.Click += new EventHandler(showWindow_Click);

            System.Windows.Forms.MenuItem exitSystem = new System.Windows.Forms.MenuItem("退出");
            exitSystem.Click += new EventHandler(exitSystem_Click);
            System.Windows.Forms.MenuItem[] menuItems = new System.Windows.Forms.MenuItem[] { showWindow, exitSystem };
            this.notifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu(menuItems);

            this.StateChanged += new EventHandler(MainWindow_StateChanged);

            setHook();

            autoRun();
            //GC.Collect();
            //GC.WaitForPendingFinalizers();
            //GC.Collect();
        }
开发者ID:dalinhuang,项目名称:loosoft,代码行数:31,代码来源:Main.xaml.cs


示例12: Init

        void Init()
        {
            this.notifyIcon = new System.Windows.Forms.NotifyIcon();
            //this.notifyIcon.BalloonTipText = "你好, 欢迎使用随身袋!";
            this.notifyIcon.Text = window.Title;
            this.notifyIcon.Icon = System.Drawing.Icon.ExtractAssociatedIcon(System.IO.Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, AppDomain.CurrentDomain.SetupInformation.ApplicationName));
            this.notifyIcon.Visible = true;
            this.notifyIcon.DoubleClick += new EventHandler(delegate
            {
                if (window.Top < 0) { window.Top = 1; }
                window.Topmost = true;
                window.Show();
                window.WindowState = wsl;

            });

            this.notifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu();
            AddMenuItem("打开随身袋", delegate
            {
                if (window.Top < 0) { window.Top = 1; }
                window.Topmost = true;
                window.Show();
                window.WindowState = wsl;
            });
            this.notifyIcon.ContextMenu.MenuItems.Add("-");
            AddMenuItem("退出",delegate { IsCanClose = true; window.Close(); });
            //this.notifyIcon.ShowBalloonTip(1000);
        }
开发者ID:zecak,项目名称:CarryBag,代码行数:28,代码来源:WindowSysMin.cs


示例13: MainWindow

        public MainWindow()
        {
            InitializeComponent();
            TasktrayIcon = new NotifyIcon
            {
                Text = "Kbtter",
                Visible = true,
                Icon = new Icon("trayicon.ico")
            };

            Player = new MediaPlayer();

            UploadImagePath = new Dictionary<string, Stream>();
            UploadImageDialog = new OpenFileDialog();
            UploadImageDialog.AddExtension = true;
            UploadImageDialog.Multiselect = true;
            UploadImageDialog.Title = "アップロードする画像を選択";
            UploadImageDialog.Filter = "対応している画像ファイル|*.png;*.jpg;*.jpeg;*.gif|PNGイメージ|*.png|JPEGイメージ|*.jpg;*.jpeg|GIFイメージ|*.gif";

            IronPythonEngine = Python.CreateEngine();
            IronPythonEngine.Runtime.LoadAssembly(this.GetType().Assembly);
            IronPythonEngine.Runtime.LoadAssembly(Assembly.LoadFrom("TweetSharp.dll"));

            TweetPlugins = new List<IKbtterOnTweet>();
            RetweetPlugins = new List<IKbtterOnRetweet>();
            FavoritePlugins = new List<IKbtterOnFavorite>();
            UnfavoritePlugins = new List<IKbtterOnUnfavorite>();
            InitializePlugins = new List<IKbtterOnInitialize>();
            WindowPlugins = new List<IKbtterCallable>();

            Settings = new Config();
        }
开发者ID:kb10uy,项目名称:Kbtter,代码行数:32,代码来源:MainWindow.Logic.cs


示例14: InitializeBackend

        public void InitializeBackend(object frontend)
        {
            statusIcon = new System.Windows.Forms.NotifyIcon ();

            //TODO: expose Visible property in the StatusIcon class
            statusIcon.Visible = true;
        }
开发者ID:7digital,项目名称:xwt,代码行数:7,代码来源:StatusIconBackend.cs


示例15: Window1

        public Window1()
        {
            InitializeComponent();

            _systemtray = new System.Windows.Forms.NotifyIcon();

            Assembly a = Assembly.GetExecutingAssembly();
            Stream logoStream = a.GetManifestResourceStream("YAWAMT.SystemTrayClient.yawamt.ico");

            _systemtray.Icon = new System.Drawing.Icon(logoStream);
            _systemtray.Visible = true;

            _systemtray.Click += new EventHandler(SystemTrayIcon_Click);
            _systemtray.MouseMove += new System.Windows.Forms.MouseEventHandler(SystemTrayIcon_MouseMove);
            _systemtray.BalloonTipShown += new EventHandler(SystemTrayIcon_BalloonTipShown);
            _systemtray.BalloonTipClosed += new EventHandler(SystemTrayIcon_BalloonTipClosed);

            _systemtray.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info;
            _systemtray.BalloonTipTitle = "yawamt";
            _systemtray.BalloonTipText = "3 down, 5 up";

            AttachContextMenu();

            try
            {
                IconBitmapDecoder decoder = new IconBitmapDecoder(logoStream, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default);
                imglogo.Source = decoder.Frames[0];
            }
            catch { }

            this.Hide();

            //if (string.IsNullOrEmpty(YAWAMT.SystemTrayClient.Properties.Settings.Default.Url))
            //    ContextMenuSettings(this, EventArgs.Empty);
        }
开发者ID:overeemm,项目名称:yawamt,代码行数:35,代码来源:Window1.xaml.cs


示例16: InitializeTrayIcon

        /// <summary>
        /// Initializes the trayicon and the contextmenu
        /// </summary>
        public static void InitializeTrayIcon()
        {
            // Initialize objects and tray icon
            NotifyIcon = new System.Windows.Forms.NotifyIcon();
            NotifyIcon.Text = "Sun Plasma";
            NotifyIcon.Icon = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location);
            NotifyIcon.DoubleClick += new EventHandler(NotifyIcon_Click);
            NotifyIcon.Visible = true;

            // Set up the context menu for the notify icon
            NotifyContextMenu = new System.Windows.Forms.ContextMenu();

            // Launch Star Citizen
            var launchStarCitizenItem = NotifyContextMenu.MenuItems.Add("Launch Star Citizen");
            var command = new ViewModel.Commands.LaunchStarCitizenCommand();
            launchStarCitizenItem.Enabled = command.CanExecute(null);
            launchStarCitizenItem.Click += (sender, args) => command.Execute(null);

            // Launch Mumble
            var launchMumble = NotifyContextMenu.MenuItems.Add("Launch Mumble");
            var commandMumble = new ViewModel.Commands.LaunchMumbleCommand();
            launchMumble.Enabled = commandMumble.CanExecute(null);
            launchMumble.Click += (sender, args) => commandMumble.Execute(null);

            // Exit
            NotifyContextMenu.MenuItems.Add("-");
            NotifyContextMenu.MenuItems.Add("Exit", NotifyContextMenuExit_Click);

            NotifyIcon.ContextMenu = NotifyContextMenu;
        }
开发者ID:RononDex,项目名称:Sun.Plasma,代码行数:33,代码来源:TrayIcon.cs


示例17: MainWindow

		public MainWindow()
		{
			InitializeComponent();

			ping = new Ping();

			ni = new System.Windows.Forms.NotifyIcon();
			ni.Icon = System.Drawing.Icon.FromHandle(Properties.Resources.plug.GetHicon());
			ni.Visible = true;
			ni.DoubleClick += delegate (object sender, EventArgs args)
			{
				this.Show();
				this.WindowState = WindowState.Normal;
			};

			intervalTextBox.Text = Properties.Settings.Default.interval;
			address1TextBox.Text = Properties.Settings.Default.addy1;
			address2TextBox.Text = Properties.Settings.Default.addy2;
			address3TextBox.Text = Properties.Settings.Default.addy3;
			statusLabel.Content = "";
			address1ResLabel.Content = "";
			address2ResLabel.Content = "";
			address3ResLabel.Content = "";

			timer = new DispatcherTimer();
			timer.Tick += new EventHandler(TimedEvent);
		}
开发者ID:PLYoung,项目名称:Connection-Monitor,代码行数:27,代码来源:MainWindow.xaml.cs


示例18: TrayIcon

        public TrayIcon()
        {
            _trayIcon = new System.Windows.Forms.NotifyIcon();
            _trayIcon.ContextMenu = new System.Windows.Forms.ContextMenu();
            _audioDeviceService = new EarTrumpetAudioDeviceService();

            var aboutString = Properties.Resources.ContextMenuAboutTitle;
            var version = Assembly.GetEntryAssembly().GetName().Version;

            var deviceSep = _trayIcon.ContextMenu.MenuItems.Add("-");
            deviceSep.Name = _deviceSeparatorName;

            var feedbackItem = _trayIcon.ContextMenu.MenuItems.Add(EarTrumpet.Properties.Resources.ContextMenuSendFeedback);
            feedbackItem.Click += Feedback_Click;

            var aboutItem = _trayIcon.ContextMenu.MenuItems.Add(String.Format("{0} Ear Trumpet {1} ...", aboutString, version));
            aboutItem.Click += About_Click;

            var exitItem = _trayIcon.ContextMenu.MenuItems.Add(EarTrumpet.Properties.Resources.ContextMenuExitTitle);
            exitItem.Click += Exit_Click;

            _trayIcon.MouseClick += TrayIcon_MouseClick;
            _trayIcon.ContextMenu.Popup += ContextMenu_Popup;
            _trayIcon.Icon = new System.Drawing.Icon(Application.GetResourceStream(new Uri("pack://application:,,,/EarTrumpet;component/Tray.ico")).Stream);
            _trayIcon.Text = string.Concat("Ear Trumpet - ", EarTrumpet.Properties.Resources.TrayIconTooltipText);
            _trayIcon.Visible = true;
        }
开发者ID:File-New-Project,项目名称:EarTrumpet,代码行数:27,代码来源:TrayIcon.cs


示例19: InitializeComponent

		/// <summary>
		/// This method is required for Windows Forms designer support.
		/// Do not change the method contents inside the source code editor. The Forms designer might
		/// not be able to load this method if it was changed manually.
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
			this.tb_Content = new System.Windows.Forms.TextBox();
			this.b_Copy = new System.Windows.Forms.Button();
			this.b_Clear = new System.Windows.Forms.Button();
			this.ni_Tray = new System.Windows.Forms.NotifyIcon(this.components);
			this.SuspendLayout();
			// 
			// tb_Content
			// 
			this.tb_Content.Location = new System.Drawing.Point(12, 12);
			this.tb_Content.Multiline = true;
			this.tb_Content.Name = "tb_Content";
			this.tb_Content.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
			this.tb_Content.Size = new System.Drawing.Size(418, 270);
			this.tb_Content.TabIndex = 0;
			// 
			// b_Copy
			// 
			this.b_Copy.Location = new System.Drawing.Point(355, 288);
			this.b_Copy.Name = "b_Copy";
			this.b_Copy.Size = new System.Drawing.Size(75, 23);
			this.b_Copy.TabIndex = 1;
			this.b_Copy.Text = "Копировать";
			this.b_Copy.UseVisualStyleBackColor = true;
			this.b_Copy.Click += new System.EventHandler(this.B_CopyClick);
			// 
			// b_Clear
			// 
			this.b_Clear.Location = new System.Drawing.Point(274, 288);
			this.b_Clear.Name = "b_Clear";
			this.b_Clear.Size = new System.Drawing.Size(75, 23);
			this.b_Clear.TabIndex = 1;
			this.b_Clear.Text = "Очистить";
			this.b_Clear.UseVisualStyleBackColor = true;
			this.b_Clear.Click += new System.EventHandler(this.B_ClearClick);
			// 
			// ni_Tray
			// 
			this.ni_Tray.Text = "Накопитель Буфера Обмена";
			this.ni_Tray.Visible = true;
			// 
			// MainForm
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.ClientSize = new System.Drawing.Size(445, 325);
			this.Controls.Add(this.b_Clear);
			this.Controls.Add(this.b_Copy);
			this.Controls.Add(this.tb_Content);
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.Name = "MainForm";
			this.Text = "Накопитель Буфера";
			this.ResumeLayout(false);
			this.PerformLayout();

		}
开发者ID:Diamur,项目名称:C-,代码行数:64,代码来源:MainForm.Designer.cs


示例20:

 void 显示托盘()
 {
     notifyIcon = new System.Windows.Forms.NotifyIcon();
     notifyIcon.Text = "微信";
     notifyIcon.Icon = System.Drawing.Icon.ExtractAssociatedIcon(System.Reflection.Assembly.GetExecutingAssembly().Location);
     notifyIcon.Visible = true;
     notifyIcon.MouseClick += OnNotifyIconClick;
 }
开发者ID:xubo245,项目名称:WeChat,代码行数:8,代码来源:Main.xaml.cs



注:本文中的System.Windows.Forms.NotifyIcon类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Forms.NumericUpDown类代码示例发布时间:2022-05-24
下一篇:
C# Forms.MenuStrip类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap