When I obtain the client area using:
The control client area expands and shrinks as it should (when the form is Resized) - when NO code is used to set the control Font Size.Code:Call GetClientRect(ctrl.hWnd, r1)
HOWEVER if one adds the following code to adjust the Font Size (using the client Height from GetClientRect)
The Font Size will expand as the control expands - HOWEVER - when the control shrinks, the control continues to expand even though the Client area shrinks.Code:ctrlFontSize = fPixelsToPoints(r1.Bottom - r1.Top) - 5 ctrl.font.SIZE = ctrlFontSize
To complicate matters more, if NO call is made to GetClientRect and just the following code is used to set the FontSize the
control seems to expand and shrink OK.
Anyone have any idea what is happening and why?Code:On Error Resume Next ctrl.font.SIZE = y_scale * dtrl.FontSize On Error GoTo 0




Reply With Quote