RE: Repost: Controls are unreachable after scroll and form resize.
- From: v-lliu@xxxxxxxxxxxxxxxxxxxx (Linda Liu [MSFT])
- Date: Thu, 20 Apr 2006 04:08:17 GMT
Hi Dave,
Thank you for your post. From your post, my understanding on this issue is:
you find that the controls on a panel in a Windows Form will be not visible
after some operations are done on the form. You wish to know whether there
is a work-around. If I'm off base, please feel free to let me know.
For research, I have created a new project in Visual Studio .Net 2003
according to the method described in your email.
The following is the procedure of my test:
1. At the beginning, all labels and textboxes on the panel in the child
form are visible and there is no scroll bars on the panel.
2. Resize the child form to be smaller with the mouse, and the panel is
resized to be smaller as well because the panel's Dock property has been
set to Fill. At this time, some of the controls on the panel are placed
outside of the bound of the panel. For the panel's AutoScroll property has
been set True, corresponding scroll bar appears.
3. Drag the scroll bar and move the panel's visible area to the
bottom-right corner which makes the controls in the top-left corner not
visible. Then if I resize the child form to the previous size
programmatically, all controls on the panel are visible again and the
locations of them are the same as the beginning. But if I hide the child
form first and then resize it programmatically, after the child form is
shown again, the size of the child form is as the same as the beginning,
scroll bars on the panel disappears and the locations of the controls are
the same as the locations after I drag the scroll bar just now. The
controls previous in the panel's left-top corner are not reachable now.
There is a starting point for a panel. When there's no scroll bar on the
panel or the panel's visible area is moved to the top-left corner, the
starting point is located on the top-left point of the panel and the
panel's AutoScrollPosition is {0, 0}. The location property of a control
on the panel is relative to the top-left corner. If there's a scroll bar on
the panel and scroll the panel, the location of the control will change and
the panel's AutoScroll Position property will change, but relative position
between the control and starting point will not change. If the relative
position between the control and starting point changes, the location of
the control when the Panel's AutoScrollPosition is {0, 0} will change. If
the location becomes negative, the control will not be reachable.
So it seems that the starting point of the panel in the child form has been
changed when resizing the form programmatically while it is hidden.
Try not displaying the child form in the MDI Parent. Removing the sentence
"child.MdiParent = this;" can make the child form not display in the MDI
Parent. I found this phenomenon doesn't exist. Thus I may make a
conclusion that starting point of the panel in the child form will be
changed when resizing it programmatically while it is hidden and opened in
a MDI Parent.
If you are going to resize a child form opened in a MDI Parent
programmatically, you should do it when the child form is shown.
Hope this is helpful to you.
If you have any other concerns or need anything else, please let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support
====================================================
When responding to posts,please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
====================================================
.
- Follow-Ups:
- RE: Repost: Controls are unreachable after scroll and form resize.
- From: Dave Leach
- RE: Repost: Controls are unreachable after scroll and form resize.
- References:
- Repost: Controls are unreachable after scroll and form resize.
- From: Dave Leach
- Repost: Controls are unreachable after scroll and form resize.
- Prev by Date: RE: System.Net.Mail and a User's Outlook profile name
- Next by Date: Re: Opening PDF within a Windows Form
- Previous by thread: RE: Repost: Controls are unreachable after scroll and form resize.
- Next by thread: RE: Repost: Controls are unreachable after scroll and form resize.
- Index(es):
Relevant Pages
|
Loading