コード例 #1
0
 private void panelExtended_Paint(object sender, PaintEventArgs e)
 {
     if (WinAPI.GetForegroundWindow() == this.Handle)
     {
         Win7Style.DrawTextOnGlass(panelExtended.Handle, labelCaption.Text, labelCaption.Font, labelCaption.Bounds, 12);
     }
     else
     {
         Win7Style.DrawTextOnGlass(panelExtended.Handle, labelCaption.Text, labelCaption.Font, labelCaption.Bounds, 12);
     }
 }
コード例 #2
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            this.Icon = IconManager.GetIcon("shell32.dll", 39, true);

            if (!System.IO.File.Exists(Installer.GetMenu98Path()))
            {
                Installer.ShowInstaller(this);
            }


            if (WinVer.IsWin10OrGreater())
            {
                Win10Style.EnableBlur(this.Handle);
            }
            else
            {
                checkBoxNoExplorerImmersiveMenu.Enabled = false;
                checkBoxEnableImmersiveMenu.Enabled     = false;
                checkBoxShowIcon.Enabled         = false;
                checkBoxHideToggleOption.Enabled = false;
            }

            if (WinVer.IsVistaOrGreater())
            {
                //DPI.SetCurrentProcessDPIAware();
                Win7Style.EnableAero(this.Handle, panelExtended.Height, panelMain.Bottom, 0, 0);
                toolStrip.Renderer = new ToolStripNonClientRender();
            }
            else
            {
                toolStrip.Renderer      = new ToolStripNonClientRender(SystemColors.Control);
                toolStrip.Location      = new Point(toolStrip.Location.X, toolStrip.Location.Y - 1);
                this.FormBorderStyle    = FormBorderStyle.FixedSingle;
                this.ControlBox         = true;
                this.Height            -= panelMain.Location.Y;
                this.panelMain.Location = new Point(panelMain.Location.X, 0);
                this.Text = labelCaption.Text;
            }

            panelFrameB.Visible = false;
            panelFrameT.Visible = false;
            panelFrameR.Visible = false;
            panelFrameL.Visible = false;

            pictureBoxAppIcon.BackgroundImage = this.Icon.ToBitmap();


            contextMenuStrip.Renderer = new ToolStripNonClientRender();

            comboBoxStyle.SelectedIndex = 0;

            FormUtils.ShowShield(buttonUpdateStartupCommand.Handle, true);
            FormUtils.ShowShield(buttonRemoveStartUp.Handle, true);

            for (int i = 0; i <= MenuControl.OSList.Length; i++)
            {
                comboBoxSysVer.Items.Add(MenuControl.GetOSFromIndex(i));
            }
            comboBoxSysVer.SelectedIndex = MenuControl.Os2ListIndex(WinVer.SystemVersion);

            checkBoxNoExplorerImmersiveMenu.Checked = Installer.ExplorerImmersiveMenuRemoved();


            if (System.IO.File.Exists(Installer.GetConfigPath()))
            {
                XML_Load(Installer.GetConfigPath());
            }
            else
            {
                switch (Installer.ShowSelectConfigFileBox(this))
                {
                case DialogResult.Yes:
                    Installer.DeployDefaultConfigFile();
                    XML_Load(Installer.GetConfigPath());
                    break;

                case DialogResult.No:
                    if (!OpenConfigUsingDialog())
                    {
                        this.Close();
                    }
                    break;

                case DialogResult.Cancel:
                    this.Close();
                    break;
                }
            }
        }