Hi Nicholas,
Thank you for the feedback.
I think this proves that I am indeed a newbie. If I change the WindowState
= Minimized
in the form properties during design time, it actually hides the form when I
run the
code. No other code was necessary.
"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> wrote
in message news:e$**************@TK2MSFTNGP11.phx.gbl...
amil,
I don't think that you can remove the "X" button, but I do think that
you can disable it. Check out knowledge base article Q184686, titled
"HOWTO: Disable the Close Option on Control Menu of a VB Form", located at
(watch for line wrap):
http://support.microsoft.com/default...b;en-us;184686
While this applies for VB6, it will show you which API calls you have
to make in order to disable the box.
As for hiding the form, you should probably override the CreateParams
property so that it returns a CreateParams instance that has the
appropriate window styles set so that your form is initially minimized.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com
"amil [c#newbie]" <am****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl... Hi all,
I am using the Notify Icon sample that came with .Net Docs and was able
to run it. However, I want to start the form as minimized. I have the
ShowInTaskbar = false and in the this is my code in the form load:
private void Form1_Load(object sender, System.EventArgs e)
{
this.WindowState = FormWindowState.Minimized;
this.Visible = false;
}
This will still display a minimized window title bar near the Windows
Start button.
It does not totally hide the form.
Also, can I remove just the "X" or close button of the form and retain
the minimize/maximize buttons?
TIA.