470,588 Members | 2,159 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,588 developers. It's quick & easy.

Scrolling panel

Hi,

I have a panel on a form that contains a number of controls, so many that
the panel has a vertical scrollbar in order to view all of them. When the
form first loads, the panel's scrollbar automatically scrolls to about the
middle rather than staying at the top. Also, when I click on one of the
controls, a dialog box appears to allow me to edit it's information. When I
click OK on the dialog box, the information on the control is changed, and
the panel's scrollbar once again scrolls to the middle. This last scenario
only happens once, on the first control I click. After that everything
works as it should. Does anyone have any idea what's going on, or what
event is firing to cause the panel to scroll automatically sometimes?

Thanks,
Nathan
Nov 21 '05 #1
2 4545
Hi,

Make sure the panels autoscrollpostion, and autoscrollmargin are set
to 0,0

http://msdn.microsoft.com/library/de...argintopic.asp

http://msdn.microsoft.com/library/de...itiontopic.asp

Ken
---------------
"Nathan" <nk*********************@softhome.net> wrote in message
news:ej**************@TK2MSFTNGP11.phx.gbl...
Hi,

I have a panel on a form that contains a number of controls, so many that
the panel has a vertical scrollbar in order to view all of them. When the
form first loads, the panel's scrollbar automatically scrolls to about the
middle rather than staying at the top. Also, when I click on one of the
controls, a dialog box appears to allow me to edit it's information. When I
click OK on the dialog box, the information on the control is changed, and
the panel's scrollbar once again scrolls to the middle. This last scenario
only happens once, on the first control I click. After that everything
works as it should. Does anyone have any idea what's going on, or what
event is firing to cause the panel to scroll automatically sometimes?

Thanks,
Nathan

Nov 21 '05 #2
Thanks Ken. The properties are set correctly in the designer, and I've also
tried the following code:

Me.pnlPCard.AutoScrollMargin = New Size(0, 0)
Me.pnlPCard.AutoScrollPosition = New Point(0, 0)

I've tried this at the beginning and end of my form_load subroutine as well
as in the designer generated code. Still getting the strange behavior. The
controls are all added at design time, if that makes a difference.

Thanks,
Nathan
Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Nathan | last post: by
1 post views Thread by John | last post: by
reply views Thread by Elroyskimms | last post: by
2 posts views Thread by shahoo | last post: by
4 posts views Thread by mateusz.zajakala | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.