I
Ian
I'm trying to create a form that is only displayed/movable within the
bounds of a parent form (i.e. the child form is clipped to the parent
form's client rectangle). I don't want to use MDI for this because
the parent form will be an MDI child. For example, there are three
forms: A, B, and C. A is an MDI parent form that contains B. Form C
is a child of B that must stay within the client area of form B. In
this example, I'm trying to create form C.
I've looked at older posts on this newsgroup that suggests using the
following code in the parent form:
Form f = new Form();
f.TopLevel = false;
f.Parent = this;
f.Show();
This achieves the clipping effect that I want; however, the child form
does not focus properly. The title bar of the child form always
remains grayed-out even if I'm moving it around or one of its child
controls is focused. In addition, the child form never raises the
Activated event and only raises the GotFocus event when minimizing the
child form then maximizing it.
Does anyone know how to get the child form to properly focus (or if
this is even possible)?
Thanks,
Ian
bounds of a parent form (i.e. the child form is clipped to the parent
form's client rectangle). I don't want to use MDI for this because
the parent form will be an MDI child. For example, there are three
forms: A, B, and C. A is an MDI parent form that contains B. Form C
is a child of B that must stay within the client area of form B. In
this example, I'm trying to create form C.
I've looked at older posts on this newsgroup that suggests using the
following code in the parent form:
Form f = new Form();
f.TopLevel = false;
f.Parent = this;
f.Show();
This achieves the clipping effect that I want; however, the child form
does not focus properly. The title bar of the child form always
remains grayed-out even if I'm moving it around or one of its child
controls is focused. In addition, the child form never raises the
Activated event and only raises the GotFocus event when minimizing the
child form then maximizing it.
Does anyone know how to get the child form to properly focus (or if
this is even possible)?
Thanks,
Ian