[RESOLVED] How to scroll to a given control
Hi to everyone. I have a panel wich inherits from FlowLayoutPanel. I add a lot of picturebox to it. I allow the user to navigate through them with arrow keys. Since I have a lot of PictureBox, most of them doesn't appear at the visible rectangle of the panel. I want this panel to scroll to the selected control when user selects it. For select a PictureBox I made a class wich inherits from it and override the OnPaint sub. I also have a field m_selected to determine whether the PictureBox is selected or not. On OnPaint sub if this field is set to true, I draw an orange border to notify the user that this control is selected, otherwise I draw a simple black one. In the panel I also have a m_currentsel field to save the control wich is actually selected. When user selects a control this field contains the selected control.
ideas?
Regards.
Re: How to scroll to a given control
You call the ScrollControlIntoView method of the container control, specifying which child control you want visible.
Re: How to scroll to a given control
Thanks! that went great!. I was searching on doing it with win api. Thanks again.