How to Close a Form when openning?
-
Let see this case: I need to show the aform, and write code aform f = new aform(someparameter); f.Show(); and in the form's code. I use "someparameter" to determine if I should still show the form or Close it. (this is done automatically, in FormLoad, constructor... etc; without anymore interaction from user (like event)) How this can be done?
-
Let see this case: I need to show the aform, and write code aform f = new aform(someparameter); f.Show(); and in the form's code. I use "someparameter" to determine if I should still show the form or Close it. (this is done automatically, in FormLoad, constructor... etc; without anymore interaction from user (like event)) How this can be done?
this.Close(); It's the wrong model though - you should work out if you want to show it before you do. Anyone looking at this code is right to assume the form will be shown. Christian Graus - Microsoft MVP - C++
-
this.Close(); It's the wrong model though - you should work out if you want to show it before you do. Anyone looking at this code is right to assume the form will be shown. Christian Graus - Microsoft MVP - C++
If at all, you want to do - Override the constructor with parameters public Form3(string args) { if args=="dontshow!" this.Close() // and dispose the object and come out } However, the best and easier way to handle is to do it before hand since you have the parameters in hand before!
-
If at all, you want to do - Override the constructor with parameters public Form3(string args) { if args=="dontshow!" this.Close() // and dispose the object and come out } However, the best and easier way to handle is to do it before hand since you have the parameters in hand before!
Why do people keep answering questions by posting under someone elses answer ? Christian Graus - Microsoft MVP - C++
-
Why do people keep answering questions by posting under someone elses answer ? Christian Graus - Microsoft MVP - C++
Christian Graus wrote: Why do people keep answering questions by posting under someone elses answer ? :laugh: I don't know why, but apparently you seems to be getting a couple of them. Weiye Chen Life is hard, yet we are made of flesh...
-
Why do people keep answering questions by posting under someone elses answer ? Christian Graus - Microsoft MVP - C++
Thats because we had answered at the same time! believe from various locations. Take care, sorry for the trouble guys for this thread!
-
Thats because we had answered at the same time! believe from various locations. Take care, sorry for the trouble guys for this thread!
No, it's not. You clicked on Reply while looking at Christian's answer! Your post is 20 minutes later this his. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome