On my project main form, I have a picture control nicely centered. For the form I have set min/max values and have set resize rule for the picture control. When I run the program and resize the window, the picture control does not move at all. Is there something else I need to do to get resizing to work? :o ???
With SizeX and SizeY, somehow the resizing will not go smaller than the Picture control height and width settings in properties. So if you have a big form with a big Picture control during design time, the resizing appears not to work.
Probably a bug.
Or you can use resizing in codes
Put this in FORM1_WM_SIZE:
Function FORM1_WM_SIZE ( _
hWndForm As Dword, _ ' handle of Form
fwSizeType As Long, _ ' type of resizing request
nWidth As Long, _ ' new width of client area
nHeight As Long _ ' new height of client area
) As Long
FF_Control_SetSize hwnd_FORM1_PICTURE1, nWidth, nHeight
End Function
The code assume the Picture control is at 0,0 at the top left and fill the entire form. Adjust the width to resize to (eg. nWidth - 20) and height to resize to (eg.nHeight - 20) accordingly to suit.
Not a bug! Paul clearly stated that a control will not be resized below it's design time size.
I must have missed that.
The main form is 1280x960, max size is set to 1280x960, min size is set to 1024x768. The picture control is 380x441 and resize rule is PropXPropY with Locked set to FALSE.
PropXPropY moves the Picture control. It does not resize.
However, it will not move the control any further left or higher up than the control's Left and Top settings at design time.
Since your form is 1280 X 960 at design time and the max is also the same, therefore when you resize the form smaller down to the min of 1024 X 768 at runtime there will be no effect.
Maybe make your form 1024 X 768 at design time if possible.
I changed the form size to 1024x768 and the max to 1920x1200 and all works well now. Does anyone have any recommendations on minimum form sizes?
Depends a little on which computers the application should run.
I would consider also Netbooks which start with a resolution of 1024 x 600.
Perhaps a reasonable compromise would be to retrieve the current screen resolution and size to that using the min/max as guildlines.
Richard,
why would you need Min / Max values for resizing at all? I could imagine the need for a minimum value, because an application might have some elements or controls that need a minimum size to operate properly. But at present I cannot think of a szenario that would call for a need to limit the maximum size of an application's main window, if it is resizable anyway. So why not leave maximizing to Windows, resize the controls in proportion, and just set the minimum size?