Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Testing for horizontal/vertical scrollbar visibility in a CExtGridWnd Collapse All
Subject Author Date
David Coleman Aug 1, 2005 - 5:52 AM

Is there a simple way to test whether horizontal/vertical scrollbars are visible in a CExtGridWnd? After changing the grid content I need to modify the column widths when the vertical scrollbar is displayed in order to prevent a horizontal scrollbar from also appearing.


Thanks,


David.

Technical Support Aug 2, 2005 - 5:24 AM

You need to call the OnSwUpdateScrollBars() method of the grid control after changing its content. This will update both scroll bars correctly including their position, mutually enabled state and visibility. You should not care about whether a particular scroll bar is visible or not. The CExtScrollWnd class, which is a base class for CExtGridWnd will do all the dirty work for you automatically. You can also invoke grid’s OnSwDoRedraw() method to repaint the content immediately.

If you do need to get information about the scroll bar, then you should call methods of the CExtScrollWnd class: OnSwHasScrollBar() returns a value that indicates whether the scroll bar is visible or enabled and CExtScrollWnd::ScrollInfo32Get() provides you with all the other scroll bar information.