Parent and child forms
-
Hello everybody, I need to make the client size of a parent form FIXED, that is no scroll bars appear when moving the child around the parent. I tried to make the auto scroll bar property in parent form set to false but it doesn't work. thanks in advance!
-
Hello everybody, I need to make the client size of a parent form FIXED, that is no scroll bars appear when moving the child around the parent. I tried to make the auto scroll bar property in parent form set to false but it doesn't work. thanks in advance!
I tried out what you described with the following code:
using System.Windows.Forms;
class Form1: Form
{
public Form1()
{
this.IsMdiContainer = true;this.AutoScroll = false; Form f = new Form(); f.MdiParent = this; f.Show();
}
public static void Main (string[] args)
{
Application.Run(new Form1());
}
}Of course, the scrollbars still appear. According to the documentation for
Form.AutoScroll
, "If this property is set to true, scroll bars are displayed on the form if any controls are located outside the form's client region." I would take this to mean that AutoScroll only applies to controls owned by the form, not MDI children. Sorry I couldn't be of more help.A little learning is a dangerous thing; Drink deep, or taste not, the Pierian Spring. —Alexander Pope
-
I tried out what you described with the following code:
using System.Windows.Forms;
class Form1: Form
{
public Form1()
{
this.IsMdiContainer = true;this.AutoScroll = false; Form f = new Form(); f.MdiParent = this; f.Show();
}
public static void Main (string[] args)
{
Application.Run(new Form1());
}
}Of course, the scrollbars still appear. According to the documentation for
Form.AutoScroll
, "If this property is set to true, scroll bars are displayed on the form if any controls are located outside the form's client region." I would take this to mean that AutoScroll only applies to controls owned by the form, not MDI children. Sorry I couldn't be of more help.A little learning is a dangerous thing; Drink deep, or taste not, the Pierian Spring. —Alexander Pope
CompMan44 wrote:
I would take this to mean that AutoScroll only applies to controls owned by the form, not MDI children.
I think you are right, thanks CompMan44:)