Esempio n. 1
0
        private void настройкиИнтерфейсаToolStripMenuItem_Click(object sender, EventArgs e)
        {
            InterfaceOption interfaceOption = new InterfaceOption();

            interfaceOption.Show(this);
        }
Esempio n. 2
0
 public MainForm()
 {
     InitializeComponent();
     try
     {
         InterfaceOption interfaceOption = new InterfaceOption();
         RegistryKey     txtRedOption    = Registry.CurrentUser;
         RegistryKey     Interface       = txtRedOption.CreateSubKey("Interface");
         mc  = Color.FromName(Interface.GetValue("MC").ToString());
         mpc = Color.FromName(Interface.GetValue("MPC").ToString());
         cc  = Color.FromName(Interface.GetValue("CC").ToString());
         tc  = Color.FromName(Interface.GetValue("TC").ToString());
     }
     catch
     {
         InterfaceOption interfaceOption = new InterfaceOption();
         RegistryKey     txtRedOption    = Registry.CurrentUser;
         RegistryKey     Interface       = txtRedOption.CreateSubKey("Interface");
         Interface.SetValue("MC", "Control");
         Interface.SetValue("MPC", "Control");
         Interface.SetValue("CC", "Control");
         Interface.SetValue("TC", "ControlText");
     }
     try
     {
         BackColor = mc;
     }
     catch
     {
         BackColor = Color.Gray;
         foreach (ToolStripComboBox micb
                  in toolStrip1.Items.OfType <ToolStripComboBox>())
         {
             micb.BackColor = Color.Gray;
             micb.ForeColor = Color.Black;
         }
     }
     finally
     {
         ForeColor              = tc;
         menuStrip1.BackColor   = cc;
         menuStrip1.ForeColor   = tc;
         statusStrip1.BackColor = cc;
         statusStrip1.ForeColor = tc;
         toolStrip1.BackColor   = mpc;
         toolStrip1.ForeColor   = tc;
         foreach (ToolStripMenuItem mi
                  in menuStrip1.Items.OfType <ToolStripMenuItem>())
         {
             mi.BackColor = cc;
             mi.ForeColor = tc;
             foreach (ToolStripItem ddi
                      in mi.DropDownItems.OfType <ToolStripItem>())
             {
                 ddi.BackColor = cc;
                 ddi.ForeColor = tc;
             }
             foreach (ToolStripSeparator ssi
                      in mi.DropDownItems.OfType <ToolStripSeparator>())
             {
                 ssi.BackColor = cc;
                 ssi.ForeColor = tc;
             }
         }
     }
 }