Launching a form with visible set to false
-
My problem : I use a notify icon on a form .. and I want to only show the notify icon and not the form ... but I didn't have any success cause the form tries to open as visible The only solutions I came up with are 1.to start a timer on form load 2.override the OnVisibleChange method and set visibble always to false I think the cause for the error is Application.Run( myform ) or probably an error with .NET Framework wich I doubt Is anybody else experiencing this or I 'm the only one who gets this king of errors . I tried to set visible false in the constructor but it still shows the form .. This error comes up in .Net 1.1 , 2.0 Beta2 , haven't tried it on 1.0.. but i'm pretty sure it's the same If you want to see that I'm write ... create a new C# project ... and in the form constructor write ,..... this.Visible = false ...... :laugh: :^) Ok... if someone can tell me why ... or if they have a more viable solution I'll whait for it Lazar Mihai Highschool student
-
My problem : I use a notify icon on a form .. and I want to only show the notify icon and not the form ... but I didn't have any success cause the form tries to open as visible The only solutions I came up with are 1.to start a timer on form load 2.override the OnVisibleChange method and set visibble always to false I think the cause for the error is Application.Run( myform ) or probably an error with .NET Framework wich I doubt Is anybody else experiencing this or I 'm the only one who gets this king of errors . I tried to set visible false in the constructor but it still shows the form .. This error comes up in .Net 1.1 , 2.0 Beta2 , haven't tried it on 1.0.. but i'm pretty sure it's the same If you want to see that I'm write ... create a new C# project ... and in the form constructor write ,..... this.Visible = false ...... :laugh: :^) Ok... if someone can tell me why ... or if they have a more viable solution I'll whait for it Lazar Mihai Highschool student
have you tried this.Opacity = 0;
-
have you tried this.Opacity = 0;
-
Quite right you are. What about setting the size of the form to zero and the borderstyle to none then? form.Size = new Size(0,0); form.FormBorderStyle = FormBorderStyle.None;
-
My problem : I use a notify icon on a form .. and I want to only show the notify icon and not the form ... but I didn't have any success cause the form tries to open as visible The only solutions I came up with are 1.to start a timer on form load 2.override the OnVisibleChange method and set visibble always to false I think the cause for the error is Application.Run( myform ) or probably an error with .NET Framework wich I doubt Is anybody else experiencing this or I 'm the only one who gets this king of errors . I tried to set visible false in the constructor but it still shows the form .. This error comes up in .Net 1.1 , 2.0 Beta2 , haven't tried it on 1.0.. but i'm pretty sure it's the same If you want to see that I'm write ... create a new C# project ... and in the form constructor write ,..... this.Visible = false ...... :laugh: :^) Ok... if someone can tell me why ... or if they have a more viable solution I'll whait for it Lazar Mihai Highschool student
Override the form's OnLoad and set the forms Visible property to false in there. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
My problem : I use a notify icon on a form .. and I want to only show the notify icon and not the form ... but I didn't have any success cause the form tries to open as visible The only solutions I came up with are 1.to start a timer on form load 2.override the OnVisibleChange method and set visibble always to false I think the cause for the error is Application.Run( myform ) or probably an error with .NET Framework wich I doubt Is anybody else experiencing this or I 'm the only one who gets this king of errors . I tried to set visible false in the constructor but it still shows the form .. This error comes up in .Net 1.1 , 2.0 Beta2 , haven't tried it on 1.0.. but i'm pretty sure it's the same If you want to see that I'm write ... create a new C# project ... and in the form constructor write ,..... this.Visible = false ...... :laugh: :^) Ok... if someone can tell me why ... or if they have a more viable solution I'll whait for it Lazar Mihai Highschool student
U can use this code (with P/Invoke implemenstation):
..... using System.Runtime.InteropServices; ..... public class Form1 : System.Windows.Forms.Form { .... protected override void OnLoad(System.EventArgs e) { WIN32 win32 = new WIN32(); win32.HideWindow(this.Handle); } ... } public class WIN32 { public WIN32() { } public void HideWindow(System.IntPtr handle) { ShowWindow(handle,WindowShowStyle.Hide); } [DllImport("user32.dll")] private static extern bool ShowWindow(IntPtr hWnd, WindowShowStyle nCmdShow); private enum WindowShowStyle : uint { Hide = 0, ShowNormal = 1, ShowMinimized = 2, ShowMaximized = 3, Maximize = 3, ShowNormalNoActivate = 4, Show = 5, Minimize = 6, ShowMinNoActivate = 7, ShowNoActivate = 8, Restore = 9, ShowDefault = 10, ForceMinimized = 11 } }
It will your main window... ;) -
My problem : I use a notify icon on a form .. and I want to only show the notify icon and not the form ... but I didn't have any success cause the form tries to open as visible The only solutions I came up with are 1.to start a timer on form load 2.override the OnVisibleChange method and set visibble always to false I think the cause for the error is Application.Run( myform ) or probably an error with .NET Framework wich I doubt Is anybody else experiencing this or I 'm the only one who gets this king of errors . I tried to set visible false in the constructor but it still shows the form .. This error comes up in .Net 1.1 , 2.0 Beta2 , haven't tried it on 1.0.. but i'm pretty sure it's the same If you want to see that I'm write ... create a new C# project ... and in the form constructor write ,..... this.Visible = false ...... :laugh: :^) Ok... if someone can tell me why ... or if they have a more viable solution I'll whait for it Lazar Mihai Highschool student
-
I have XP ... there is where it doesn't work ... Lazar Mihai Highschool student
-
Override the form's OnLoad and set the forms Visible property to false in there. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
Overriding doesn't work ... I 've tried it ... it was probably the first thing I tried ... Lazar Mihai Highschool student