Beispiel #1
0
        // Add the menu for the setup form to the system menu for this form
        private void MainForm_Load(object sender, EventArgs e)
        {
            this.FormBorderStyle = FormBorderStyle.None;
            this.WindowState     = FormWindowState.Maximized;

            IntPtr systemMenuHandle = GetSystemMenu(this.Handle, false);

            commsForm = new CommsForm(this);

            if (systemMenuHandle != IntPtr.Zero)
            {
                // Add a separator
                AppendMenu(systemMenuHandle, MF_SEPARATOR, 0, string.Empty);

                // Add the About menu item
                AppendMenu(systemMenuHandle, MF_STRING, SYSTEM_MENU_SETUP_ID, "&Setup…");
            }
            pictureBoxCommsForm_Click(null, null);

            // Start the tick timer
            tickTimer = new System.Threading.Timer(tickTimerCallback, null, tickTimerDurationSeconds * 1000, 0);
        }
Beispiel #2
0
        // Add the menu for the setup form to the system menu for this form
        private void MainForm_Load(object sender, EventArgs e)
        {
            this.FormBorderStyle = FormBorderStyle.None;
            this.WindowState = FormWindowState.Maximized;

            IntPtr systemMenuHandle = GetSystemMenu(this.Handle, false);
            commsForm = new CommsForm(this);

            if (systemMenuHandle != IntPtr.Zero)
            {
                // Add a separator
                AppendMenu(systemMenuHandle, MF_SEPARATOR, 0, string.Empty);

                // Add the About menu item
                AppendMenu(systemMenuHandle, MF_STRING, SYSTEM_MENU_SETUP_ID, "&Setup…");
            }
            pictureBoxCommsForm_Click(null, null);

            // Start the tick timer
            tickTimer = new System.Threading.Timer(tickTimerCallback, null, tickTimerDurationSeconds * 1000, 0);
        }