is it possible to do this?
-
to make mass data entry easier so i can put my add form over the top of my excel sheet that contains the data i wish to enter. Is there a way to do the following without it minimizing both. I understand the whole parent/child relationship of the forms but i was wondering if i could somehow do this because I have noticed programs like yahoo and so forth allow one form to be minimized while the other is maximized. Anyway here is what I'm trying...
private void Add_Button_Click(object sender, EventArgs e)
{
AddRecord addRecordForm = new AddRecord();
addRecordForm.Owner = this;
this.WindowState = FormWindowState.Minimized; //minimize the main form
addRecordForm.ShowDialog(this); // load up the add formthis.WindowState = FormWindowState.Normal; //when the add form closes return main form to normal size LoadData(); }
it minimizes but they both minimize instead of only the parent minimizing. i even tried putting in the constructor of the addrecord this.windowstate = formwindowstate.normal; and that had no effect.
-
to make mass data entry easier so i can put my add form over the top of my excel sheet that contains the data i wish to enter. Is there a way to do the following without it minimizing both. I understand the whole parent/child relationship of the forms but i was wondering if i could somehow do this because I have noticed programs like yahoo and so forth allow one form to be minimized while the other is maximized. Anyway here is what I'm trying...
private void Add_Button_Click(object sender, EventArgs e)
{
AddRecord addRecordForm = new AddRecord();
addRecordForm.Owner = this;
this.WindowState = FormWindowState.Minimized; //minimize the main form
addRecordForm.ShowDialog(this); // load up the add formthis.WindowState = FormWindowState.Normal; //when the add form closes return main form to normal size LoadData(); }
it minimizes but they both minimize instead of only the parent minimizing. i even tried putting in the constructor of the addrecord this.windowstate = formwindowstate.normal; and that had no effect.
I have tried compile example into .NET 2.0/3.0/3.5. I am using Windows 7 and didn't encounter your problem. Did you accedently changed windowstato of your AddRecord Form?
-
to make mass data entry easier so i can put my add form over the top of my excel sheet that contains the data i wish to enter. Is there a way to do the following without it minimizing both. I understand the whole parent/child relationship of the forms but i was wondering if i could somehow do this because I have noticed programs like yahoo and so forth allow one form to be minimized while the other is maximized. Anyway here is what I'm trying...
private void Add_Button_Click(object sender, EventArgs e)
{
AddRecord addRecordForm = new AddRecord();
addRecordForm.Owner = this;
this.WindowState = FormWindowState.Minimized; //minimize the main form
addRecordForm.ShowDialog(this); // load up the add formthis.WindowState = FormWindowState.Normal; //when the add form closes return main form to normal size LoadData(); }
it minimizes but they both minimize instead of only the parent minimizing. i even tried putting in the constructor of the addrecord this.windowstate = formwindowstate.normal; and that had no effect.
tonyonlinux wrote:
addRecordForm.Owner = this; this.WindowState = FormWindowState.Minimized;
tonyonlinux wrote:
it minimizes but they both minimize instead of only the parent minimizing
Does it really? Have you read the documentation[^]. Which is what you always should do when running into a problem. :|
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that.
All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
-
to make mass data entry easier so i can put my add form over the top of my excel sheet that contains the data i wish to enter. Is there a way to do the following without it minimizing both. I understand the whole parent/child relationship of the forms but i was wondering if i could somehow do this because I have noticed programs like yahoo and so forth allow one form to be minimized while the other is maximized. Anyway here is what I'm trying...
private void Add_Button_Click(object sender, EventArgs e)
{
AddRecord addRecordForm = new AddRecord();
addRecordForm.Owner = this;
this.WindowState = FormWindowState.Minimized; //minimize the main form
addRecordForm.ShowDialog(this); // load up the add formthis.WindowState = FormWindowState.Normal; //when the add form closes return main form to normal size LoadData(); }
it minimizes but they both minimize instead of only the parent minimizing. i even tried putting in the constructor of the addrecord this.windowstate = formwindowstate.normal; and that had no effect.
here's a working example: In the Main form/container, on the add click do something like this:
this.WindowState = FormWindowState.Minimized; this.ShowInTaskbar = false; Form2 f = new Form2(); f.Owner = this; f.Show(); //this.WindowState = FormWindowState.Maximized;
and on the LoadDataForm on the form closing event do something like this:
private void Form2_FormClosing(object sender, FormClosingEventArgs e)
{
this.Owner.ShowInTaskbar = true;
this.Owner.WindowState = FormWindowState.Normal;
} -
here's a working example: In the Main form/container, on the add click do something like this:
this.WindowState = FormWindowState.Minimized; this.ShowInTaskbar = false; Form2 f = new Form2(); f.Owner = this; f.Show(); //this.WindowState = FormWindowState.Maximized;
and on the LoadDataForm on the form closing event do something like this:
private void Form2_FormClosing(object sender, FormClosingEventArgs e)
{
this.Owner.ShowInTaskbar = true;
this.Owner.WindowState = FormWindowState.Normal;
}thanks that worked.
-
here's a working example: In the Main form/container, on the add click do something like this:
this.WindowState = FormWindowState.Minimized; this.ShowInTaskbar = false; Form2 f = new Form2(); f.Owner = this; f.Show(); //this.WindowState = FormWindowState.Maximized;
and on the LoadDataForm on the form closing event do something like this:
private void Form2_FormClosing(object sender, FormClosingEventArgs e)
{
this.Owner.ShowInTaskbar = true;
this.Owner.WindowState = FormWindowState.Normal;
}i was wondering something since the documentation states if the parent minimizes so does the child. (this was really my original question) because i had read this in the documentation BEFORE asking. is it possible to make the add form an owner of itself? i tried and it said I can't. Basically what I'm trying to achieve all of the parent/child stuff asside is the following. I guess what i want is the form to not be a child but simply another parent (per say). I'm trying to make it where when i click on the addbutton up pops the addrecord form. and the main form minimizes. as documented and seen and so forth both will minimize. sure i can go down there and click on the thing to open it back up since the mainform is hidden until close(that part i like) but i want the child form return to normal state. is there some kinda method that you can use on the form like you do controls as form1.visible = false or hidden = true or something like that then change that on the form2 closeevent ?
-
i was wondering something since the documentation states if the parent minimizes so does the child. (this was really my original question) because i had read this in the documentation BEFORE asking. is it possible to make the add form an owner of itself? i tried and it said I can't. Basically what I'm trying to achieve all of the parent/child stuff asside is the following. I guess what i want is the form to not be a child but simply another parent (per say). I'm trying to make it where when i click on the addbutton up pops the addrecord form. and the main form minimizes. as documented and seen and so forth both will minimize. sure i can go down there and click on the thing to open it back up since the mainform is hidden until close(that part i like) but i want the child form return to normal state. is there some kinda method that you can use on the form like you do controls as form1.visible = false or hidden = true or something like that then change that on the form2 closeevent ?