Monday, May 29, 2017

The client rectangle only considers the scroll bars sometimes

.NET controls have a ClientRectangle property that gives the measurements of the inside of the control, not counting borders or scroll bars. Weirdly, it seems that scrollbars are not always considered. In Policy Plus's Loaded ADMX Files window, where a column header in a list view is resized to barely fit without creating a horizontal scrollbar, the width of a vertical scrollbar only needs to be subtracted out when the dialog is first being set up. After that (during the resize handler), it can be safely ignored; the client rectangle shrinks to make way for it.

No comments:

Post a Comment