For minimizing and maximizing
-
Hi, I have a strange problem. Hopefully someone can help me here. I have a Form (lets call it FormA) where I execute the following code:
FormB f = new FormB();
f.ShowInTaskbar = false;
f.Owner = this;
f.Show();Now I have a form (the standard Sizable one) which always hangs over FormA. I can resize, minimize and maximize it normally. But when FormB is maximized and then minimize and restore FormA then Form B isn't maximized anymore. It also gets restored to a normal size which I don't want to happen. Any ideas?
-
Hi, I have a strange problem. Hopefully someone can help me here. I have a Form (lets call it FormA) where I execute the following code:
FormB f = new FormB();
f.ShowInTaskbar = false;
f.Owner = this;
f.Show();Now I have a form (the standard Sizable one) which always hangs over FormA. I can resize, minimize and maximize it normally. But when FormB is maximized and then minimize and restore FormA then Form B isn't maximized anymore. It also gets restored to a normal size which I don't want to happen. Any ideas?
-
Likely you may actually be creating a new copy of FormB rather then restoring the original copy. You could verify this by removing or commenting out the f.ShowInTaskbar entry. Later :)
Let me clarify this. I'm not restoring anything... The situation is that FormA is maximized on on monitor. Then FormB is created and maximized on the other monitor (by the user). If the user clicks on the minimize button of FormA than both forms are minimized. So far so good. If the user reactivates FormA then FormA gets restored to full size but not FormB.
-
Hi, I have a strange problem. Hopefully someone can help me here. I have a Form (lets call it FormA) where I execute the following code:
FormB f = new FormB();
f.ShowInTaskbar = false;
f.Owner = this;
f.Show();Now I have a form (the standard Sizable one) which always hangs over FormA. I can resize, minimize and maximize it normally. But when FormB is maximized and then minimize and restore FormA then Form B isn't maximized anymore. It also gets restored to a normal size which I don't want to happen. Any ideas?
Surely you can't reference yourself in f.Owner. Form.Owner sets a reference to another Form which owns it. Top-level forms can't have an owner, which is what I'm assume you are doing by referencing yourself. I'm could be wrong though! Graham. -- modified at 19:31 Tuesday 25th April, 2006 On further research, when a parent form is minimized or maximized is also minimizes or maximizes it's owned forms. This would account for your code hanging as it's getting into an infinite loop due to f.Owner.
-
Surely you can't reference yourself in f.Owner. Form.Owner sets a reference to another Form which owns it. Top-level forms can't have an owner, which is what I'm assume you are doing by referencing yourself. I'm could be wrong though! Graham. -- modified at 19:31 Tuesday 25th April, 2006 On further research, when a parent form is minimized or maximized is also minimizes or maximizes it's owned forms. This would account for your code hanging as it's getting into an infinite loop due to f.Owner.
Have a closer look at my code. It resides in FormA (which is
this
) and sets itself to a brand new instance of FormB. So no self referencing and also no hanging or infinite loop. -
Have a closer look at my code. It resides in FormA (which is
this
) and sets itself to a brand new instance of FormB. So no self referencing and also no hanging or infinite loop.Opps... :-O Misread your code!