Scrolling panel

N

Nathan

Hi,

I have a panel on a form that contains a number of controls (all created at
design time), so many that the panel has a vertical scrollbar in order to
view all of them (panel1.AutoScroll = True). When the form first loads, the
panel's scrollbar automatically scrolls to about the middle rather than
staying at the top. After moving the scrollbar to the top, I click on one
of the controls, and 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. If I scroll to the top, then click a button that refills the
controls with different information, this problem disappears. Does anyone
have any idea what's going on, or what event is firing to cause the panel to
scroll automatically sometimes?

Thanks,
Nathan
 
H

Herfried K. Wagner [MVP]

Nathan said:
Does anyone have any idea what's going on, or what event is firing to
cause the panel to scroll automatically sometimes?

Maybe a control that is not visible gets the focus and thus makes the panel
scroll.
 
N

Not Aaron

You might be able to put a blank control at the top and do a
Control.Select() after the panel is populated. Or if you know that a
certain control will always be at the top, select that one.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top