Scroll the scroll bar to the bottom

Source: Internet
Author: User

I thought it was a very small problem, but it has never been used, so it is very inconvenient to use it now. I would like to write it down here and review the ScrollableControl class.

Sometimes, we need to display the scroll bar of the Form to display some space outside the Form. In most cases, we may use Panel, ContainerControl (Form) controls that can set the AutoScroll attribute.

The AutoScroll attribute is provided by the ScrollableControl class. In this class, all the settings that require the scroll bar are provided. The AutoScrollPosition attribute is of the Point type and the current scroll position of the scroll bar is set, according to the MSDN explanation:

AutoScrollPosition indicates the position of the scroll control display box. If the control starts to scroll away from its starting position (0, 0 ), And The coordinate value is negative. When setting this attribute, you must always specify a positive And Value to set the scroll position relative to the starting position. For example, if both x and y are set to 200, the scroll bar moves 200 pixels to the right. If both x and y are set to 100, the scroll bar moves 100 pixels to the left, because the 100 pixels are set to the distance from the start position. For the first setting, AutoScrollPosition returns {-200, 0}; for the second setting, it returns {-, 0 }.

Then, it is set to the lowest position of the vertical scroll bar:

This. VerticalScroll. Value = this. VerticalScroll. Maximum

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.