I have two panels, and when the first panel is scrolled, I want the other one to be scrolled, How do I do that?
thanks in advance :).
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can listen for ScrollableControl.Scroll to find out when it’s scrolling.
Unfortunately I don’t know of any easy way to make the other one scroll to the correct location, but I think you should be able to do it by sending
WM_VSCROLLorWM_HSCROLLto it using the SendMessage API function.Depending on the contents of the panels you might also be able to “cheat” by setting
AutoScrolltotrueand then whenever the first panel is scrolled, you set focus to a suitable control in the second panel that is outside the currently visible area and so make it scroll to there. But I’m not sure how well this would work or if it would be easier than doing it properly (if you always want to scroll to the extreme sides of the panel, it might be useful).