1
votes

I am having this strange problem with the start position of the MDI child Form. Here is my code for the start position, I wanted it to be the middle left of the MDI Parent Form.

        //show the task bar
        ChildForm c1 = new ChildForm();

        c1.MdiParent = this;
        c1.StartPosition = FormStartPosition.Manual;
        c1.Location = new Point(0, this.Height/2);

Strange thing is every time I start my Mdi parent form, the vertical scrollbar show up and the mdi child form is position lower than half of the MDI parent form's height. Then if I scroll the scroll bar down to see the whole mdi child form, the scrollbar disappear.

After this point, no matter how I change the size of the mdi parent form, the scrollbar will not show up again.

Does Anybody knows Why?

Also, I was wondering if it is possible to hide a mdi child form with only a handle-like control left in the mdi parent form. If the user click that handle, then the form show up again. If the user click somewhere else, the form hide. It is kind of like Window taskbar.

I tried to use form.hide(), but it hides the whole mdi child form.

Thanks

Alex

2
You could consider vote for the correct question! :-)Please_Dont_Bully_Me_SO_Lords

2 Answers

3
votes

Is is possible that your calculation is taking into account the windows bar at the top.

You can have a look at PointToClient or PointToScreen

1
votes

you sholud minuse child form height and width like this

c1.Location = new Point(0, (this.Height - c1.Height)/2);