Ejemplo n.º 1
0
        public MainGUI()
        {
            InitializeComponent();

            try
            {
                CommonLibrary.AppConfig appConfig = new CommonLibrary.AppConfig(BusinessLayer.Constants.CONGIF_FILE);

                if (appConfig.GetValue("FirstRun").Equals("yes"))
                {
                    Options _Options = new Options();
                    _Options.Show();
                }
            }
            catch (Exception ex)
            {
                System.Windows.MessageBox.Show("MainGUI:" + ex.Message);
            }

            NotifyMenu              = new System.Windows.Forms.ContextMenuStrip();
            mnuAboutUs              = new System.Windows.Forms.ToolStripMenuItem();
            mnuExit                 = new System.Windows.Forms.ToolStripMenuItem();
            mnuOptions              = new System.Windows.Forms.ToolStripMenuItem();
            mnuEditMyProfile        = new System.Windows.Forms.ToolStripMenuItem();
            mnuEditMyProfile.Click += new EventHandler(mnuEditMyProfile_Click);
            mnuOptions.Click       += new EventHandler(mnuOptions_Click);

            //
            // mnuAboutUs
            //
            mnuAboutUs.Name = "mnuAboutUs";
            mnuAboutUs.Size = new System.Drawing.Size(152, 22);
            mnuAboutUs.Text = "About Us";

            //
            // mnuExit
            //
            mnuExit.Name   = "mnuExit";
            mnuExit.Size   = new System.Drawing.Size(152, 22);
            mnuExit.Text   = "Exit";
            mnuExit.Click += new EventHandler(mnuExit_Click);


            //
            // mnuOptions
            //
            mnuOptions.Name = "mnuOptions";
            mnuOptions.Size = new System.Drawing.Size(152, 22);
            mnuOptions.Text = "Options";

            //
            // mnuOptions
            //
            mnuEditMyProfile.Name = "mnuEditMyProfile";
            mnuEditMyProfile.Size = new System.Drawing.Size(152, 22);
            mnuEditMyProfile.Text = "Edit My Profile";

            //
            // NotifyMenu
            //
            NotifyMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
                mnuOptions,
                mnuEditMyProfile,
                mnuAboutUs,
                mnuExit
            });
            NotifyMenu.Name = "NotifyMenu";
            NotifyMenu.Size = new System.Drawing.Size(153, 92);



            // NotifyIcon
            m_notifyIcon = new System.Windows.Forms.NotifyIcon();
            m_notifyIcon.ContextMenuStrip = NotifyMenu;
            m_notifyIcon.BalloonTipText   = "The app has been minimised. Click the tray icon to show.";
            m_notifyIcon.BalloonTipTitle  = "The App";
            m_notifyIcon.Text             = "The App";
            m_notifyIcon.Icon             = new System.Drawing.Icon(@"Icons\Icon.ico");
            m_notifyIcon.MouseClick      += new System.Windows.Forms.MouseEventHandler(m_notifyIcon_MouseClick);
            ShowTrayIcon(true);
        }
Ejemplo n.º 2
0
        void mnuOptions_Click(object sender, EventArgs e)
        {
            Options _Options = new Options();

            _Options.Show();
        }