PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Richard Kelly on March 20, 2010, 07:18:38 AM

Title: Resizing 3.07 How To?
Post by: Richard Kelly on March 20, 2010, 07:18:38 AM
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 ???
Title: Re: Resizing 3.07 How To?
Post by: Cho Sing Kum on March 20, 2010, 10:14:34 AM
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.
Title: Re: Resizing 3.07 How To?
Post by: Rolf Brandt on March 20, 2010, 02:09:00 PM
Not a bug! Paul clearly stated that a control will not be resized below it's design time size.
Title: Re: Resizing 3.07 How To?
Post by: Cho Sing Kum on March 20, 2010, 03:52:42 PM
I must have missed that.
Title: Re: Resizing 3.07 How To?
Post by: Richard Kelly on March 20, 2010, 06:36:13 PM
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.
Title: Re: Resizing 3.07 How To?
Post by: Cho Sing Kum on March 21, 2010, 02:49:37 AM
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.
Title: Re: Resizing 3.07 How To?
Post by: Richard Kelly on March 21, 2010, 05:08:33 AM
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?
Title: Re: Resizing 3.07 How To?
Post by: Rolf Brandt on March 21, 2010, 05:15:46 AM
Depends a little on which computers the application should run.

I would consider also Netbooks which start with a resolution of 1024 x 600.
Title: Re: Resizing 3.07 How To?
Post by: Richard Kelly on March 21, 2010, 07:02:50 PM
Perhaps a reasonable compromise would be to retrieve the current screen resolution and size to that using the min/max as guildlines.
Title: Re: Resizing 3.07 How To?
Post by: Rolf Brandt on March 22, 2010, 05:28:05 AM
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?