druknhik Posted August 2, 2004 Posted August 2, 2004 I have a panel with autoscroll set to true, and I would like to set the scroll position. I cut and pasting some examples from online using the API calls, but nothing worked. Can anybody help me out? Quote
Administrators PlausiblyDamp Posted August 2, 2004 Administrators Posted August 2, 2004 Could you give a bit more detail about what you are trying to do - is it set the scroll to an absolute position or simply allow a particular control to be visible? If the latter then the panel has a ScrollControlIntoView method which does it for you. If you need to set it to a particular position how are you attempting this? Could you post your existing code? Also is there a reason why you are resorting to API calls rather than the native .Net functionality to achieve this? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
druknhik Posted August 2, 2004 Author Posted August 2, 2004 Could you give a bit more detail about what you are trying to do - is it set the scroll to an absolute position or simply allow a particular control to be visible? If the latter then the panel has a ScrollControlIntoView method which does it for you. If you need to set it to a particular position how are you attempting this? Could you post your existing code? Also is there a reason why you are resorting to API calls rather than the native .Net functionality to achieve this? I'm attempting the former. I've resorted to the API calls, because the native .NET functionality, which I assume means the AutoScrollPosition property, didn't work either. Quote
Administrators PlausiblyDamp Posted August 2, 2004 Administrators Posted August 2, 2004 What do you mean by didn't work? Just had a quick play with the autoscrollposition property and it certainly scrolled the control around okay. Could you post your code and a brief description of what it should do - it's a lot easier to see problems when the code is visible. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
druknhik Posted August 2, 2004 Author Posted August 2, 2004 What do you mean by didn't work? Just had a quick play with the autoscrollposition property and it certainly scrolled the control around okay. Could you post your code and a brief description of what it should do - it's a lot easier to see problems when the code is visible. panel1.AutoScrollPosition = new Point(0, 300); Quote
Administrators PlausiblyDamp Posted August 2, 2004 Administrators Posted August 2, 2004 And nothing happened at all or did it just not scroll to the correct position? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
druknhik Posted August 2, 2004 Author Posted August 2, 2004 And nothing happened at all or did it just not scroll to the correct position? nothing at all Quote
Administrators PlausiblyDamp Posted August 2, 2004 Administrators Posted August 2, 2004 Worked perfectly well here - are you trying to scroll vertically or horizontally? Your code will scroll it vertically down by 300 pixels from it's start position - if the scroll bar is already 300 pixels down then it will not appear to move. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
druknhik Posted August 2, 2004 Author Posted August 2, 2004 Worked perfectly well here - are you trying to scroll vertically or horizontally? Your code will scroll it vertically down by 300 pixels from it's start position - if the scroll bar is already 300 pixels down then it will not appear to move. I am trying to scroll vertically. The default position of the scroll bars is 0,0. So I'm assuming this means the scroll bar is not 300 pixels down. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.