Author Topic: Start minimized  (Read 2168 times)

0 Members and 1 Guest are viewing this topic.

A_LOTA_NOTA

  • Guest
Start minimized
« on: July 29, 2008, 04:09:40 PM »
If my program has been ran before I would like it to start minimized. I have not done much work in C# & still have a lot to learn, but I don't see why this won’t work. The time starts but the program does not start minimized.

Code: [Select]
RegistryKey key = Registry.CurrentUser.OpenSubKey("Software\\MyTest\\StartUp");
            if (key == null)
            {
                key = Registry.CurrentUser.CreateSubKey("Software\\MyTest\\StartUp");
            }
            else
            {
                tmrTest.Enabled = true;// start timer
                Hide();
            }// end else

Thanks for the help!

A_LOTA_NOTA

  • Guest
Re: Start minimized
« Reply #1 on: July 29, 2008, 05:42:16 PM »
I got it to work the way I wanted.

Code: [Select]
RegistryKey key = Registry.CurrentUser.OpenSubKey("Software\\MyTest\\StartUp");
            if (key == null)
            {
                key = Registry.CurrentUser.CreateSubKey("Software\\MyTest\\StartUp");
            }
            else
            {
                tmrTest.Enabled = true;// start timer
                this.WindowState = FormWindowState.Minimized;
                ShowInTaskbar = false;
            }// end else