Specify the rightmost column in the FlexGrid Control

Source: Internet
Author: User
Tags reflector
The FlexGrid Control allows you to specify columns to be displayed on the left. To meet project requirements, you must be able to specify columns to the rightmost.
Implementation Method:
Obtain the customer area width of the table, and then calculate the horizontal scroll bar position based on the width of each column.
But there is a problem, that is, the vertical scroll bar.
First, you must be able to determine whether a vertical scroll bar exists,
When there is a vertical scroll bar, you need to subtract the width of the vertical scroll bar,
However, the control does not provide this interface.

The following two conditions may apply to the widget's scroll bar:
1. FlexGrid is a composite control that contains a scroll bar object.
In this case, you can use reflector to view the Object Name and access the internal scroll bar object through reflection.

2. Is a traditional Win32 scrolling form.
In this way, you can use the Win32 API function to determine.

Use reflector to check the controlCodeIs the second case.
So we use Win32 API.
Use API functions
Lstyle = getwindowlong (hwnd, gwl_style );
Obtain the style and then determine
Whether ws_vscroll exists in the style.

If yes, a vertical scroll bar exists.
Then obtain the maximum and minimum values of the scroll bar. If they are equal, the scroll bar is invisible. If they are not equal, they are visible.

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.