コード例 #1
0
        public MainWindow()
        {
            WindowState = FormWindowState.Maximized;

            tableLayoutPanel2 = new TableLayoutPanel();
            NotifySection     = new NotifySection();
            navigationControl = new NavigationControl();
            tableLayoutPanel2.SuspendLayout();
            SuspendLayout();
            //
            // tableLayoutPanel2
            //
            tableLayoutPanel2.ColumnCount = 1;
            tableLayoutPanel2.RowCount    = 2;
            tableLayoutPanel2.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
            tableLayoutPanel2.Controls.Add(NotifySection, 0, 1);
            tableLayoutPanel2.Controls.Add(navigationControl, 0, 0);
            tableLayoutPanel2.Dock = DockStyle.Fill;
            tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
            tableLayoutPanel2.RowStyles.Add(new RowStyle());
            //
            // notifySection1
            //
            NotifySection.AutoSize     = true;
            NotifySection.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            NotifySection.BackColor    = Color.Transparent;
            NotifySection.Dock         = DockStyle.Fill;
            //
            // navigationControl1
            //
            navigationControl.BackColor = Color.Black;
            navigationControl.Dock      = DockStyle.Fill;
            //
            // MainWindow
            //
            Controls.Add(tableLayoutPanel2);
            MinimumSize = new Size(1024, 700);


            FormClosing += MainWindow_FormClosing;
            Load        += MainWindow_Load;
            SizeChanged += Window_StateChanged;
            tableLayoutPanel2.ResumeLayout(false);
            tableLayoutPanel2.PerformLayout();
            ResumeLayout(false);

            Instance = this;

            btnExit = new ToolStripMenuItem {
                Name = "btnExit", Size = new Size(92, 22), Text = "Exit"
            };
            btnExit.Click += btnExit_Click;

            trayStrip = new ContextMenuStrip();
            trayStrip.Items.AddRange(new ToolStripItem[] { btnExit });
            trayStrip.Name = "trayStrip";
            trayStrip.Size = new Size(93, 26);

            systrayIcon = new NotifyIcon {
                ContextMenuStrip = trayStrip, Text = "Zero-K", Visible = true
            };
            systrayIcon.MouseDown         += systrayIcon_MouseDown;
            systrayIcon.BalloonTipClicked += systrayIcon_BalloonTipClicked;

            if (!Program.Conf.StartMaximized)
            {
                SwitchFullscreenState(false);
            }

            Spring.AnySpringStarted += (sender, args) =>
            {
                if (lastTopMostState == null)
                {
                    lastTopMostState = TopMost;
                }
                if (TopMost)
                {
                    InvokeFunc(() => { TopMost = false; });
                }
            };
            Spring.AnySpringExited += (sender, args) =>
            {
                if (lastTopMostState == true)
                {
                    InvokeFunc(() => { TopMost = true; });
                }
                lastTopMostState = null;
            };
        }
コード例 #2
0
        public MainWindow() {
            WindowState = FormWindowState.Maximized;

            tableLayoutPanel2 = new TableLayoutPanel();
            NotifySection = new NotifySection();
            navigationControl = new NavigationControl();
            tableLayoutPanel2.SuspendLayout();
            SuspendLayout();
            // 
            // tableLayoutPanel2
            // 
            tableLayoutPanel2.ColumnCount = 1;
            tableLayoutPanel2.RowCount = 2;
            tableLayoutPanel2.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
            tableLayoutPanel2.Controls.Add(NotifySection, 0, 1);
            tableLayoutPanel2.Controls.Add(navigationControl, 0, 0);
            tableLayoutPanel2.Dock = DockStyle.Fill;
            tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
            tableLayoutPanel2.RowStyles.Add(new RowStyle());
            // 
            // notifySection1
            // 
            NotifySection.AutoSize = true;
            NotifySection.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            NotifySection.BackColor = Color.Transparent;
            NotifySection.Dock = DockStyle.Fill;
            // 
            // navigationControl1
            // 
            navigationControl.BackColor = Color.Black;
            navigationControl.Dock = DockStyle.Fill;
            // 
            // MainWindow
            // 
            Controls.Add(tableLayoutPanel2);
            MinimumSize = new Size(1280,1024);


            FormClosing += MainWindow_FormClosing;
            Load += MainWindow_Load;
            SizeChanged += Window_StateChanged;
            tableLayoutPanel2.ResumeLayout(false);
            tableLayoutPanel2.PerformLayout();
            ResumeLayout(false);
            
            Instance = this;

            btnExit = new ToolStripMenuItem { Name = "btnExit", Size = new Size(92, 22), Text = "Exit" };
            btnExit.Click += btnExit_Click;

            trayStrip = new ContextMenuStrip();
            trayStrip.Items.AddRange(new ToolStripItem[] { btnExit });
            trayStrip.Name = "trayStrip";
            trayStrip.Size = new Size(93, 26);

            systrayIcon = new NotifyIcon { ContextMenuStrip = trayStrip, Text = "Zero-K", Visible = true };
            systrayIcon.MouseDown += systrayIcon_MouseDown;
            systrayIcon.BalloonTipClicked += systrayIcon_BalloonTipClicked;


            if (Debugger.IsAttached) SwitchFullscreenState(false);
        }