SmartSize ActiveX component
Version 1.0, © Compositae 1999.
Features
The SmartSize ActiveX component is designed to allow complete control when the controls on a form are resized. Each control can be resized separately, or dependent on other controls.
Only the size of the controls is resized, not the font sizes. Carefully selecting which controls to resize and the method of resizing will optimize the presentation of information.
SmartSize also supports resizing of controls on SSTab, and optional resizing of columns in MSFlexGrid and DBGrid controls.
To optimize performance, several SmartSize objects can be created when groups of controls are shown or hidden as units (for example tabs in SSTab)
Versions
In the shareware version, up to 10 controls can be resized.
The full version ($29), has no limitation on the number of controls that can be resized. In addition, the full source code is included. This makes it possible to include the classes directly into a project, thus eliminating the need to distribute an additional DLL. The full version can be downloaded from: http://shareit1.element5.com/programs.html?productid=104615&language=English
Usage
To enable resizing on a form, simply follow these steps (see Methods and properties below for further details):
1. Create one (or more) SmartSize object(s).
Private ss As New CSmartSize
2. Add controls and set parent (optional) in Form_Load() event.
ss.Parent = Me
ss.Add Text1, Me, rsNone, rsNone, rsFix, rsRel
ss.Add Text2, Text1, rsNone, rsFix, rsFix, rsFix
ss.Add Text3, Me, rsNone, rsFix, rsFix, rsFix
3. Perform resizing in Form_Resize() event.
ss.Resize
Methods and properties
Add method
Adds a control to the collection of controls to be resized.
Syntax
object.Add Ctrl, CtrlRef, MoveLeft, MoveTop, MoveRight, MoveBottom, SizeGrid
Part |
Description |
object |
Required. CSmartSize object. |
Ctrl |
Required. Control to be resized. |
CtrlRef |
Required. Control or form to be used as reference when resizing. If set to Nothing, the parent form (Me) is used as default. |
MoveLeft |
Required. Specifies movement of the controls left side. See movement constants below. |
MoveTop |
Required. Specifies movement of the controls top side. See movement constants below. |
MoveRight |
Required. Specifies movement of the controls right side. See movement constants below. |
MoveBottom |
Required. Specifies movement of the controls bottom side. See movement constants below. |
SizeGrid |
Optional. If set to True, columns in MSFlexGrid and DBGrid controls are automatically resized. |
Movement constants
rsNone |
No movement when resizing. |
rsFix |
Keep position fixed relative to the size of CtrlRef. |
rsRel |
Set position relative to the resizing of CtrlRef. |
Count property
Return number of controls in the resize collection.
Syntax
count = object.Count
Part |
Description |
object |
Required. CSmartSize object. |
Parent property
Set parent object of the controls in the resize collection. Used to lock window updates during resizing to reduce flickering on the screen.
Syntax
object.Parent = ObjParent
Part |
Description |
object |
Required. CSmartSize object. |
ObjParent |
Required. Parent object of the controls to be resized. |
Remove method
Removes a control from the resize collection.
Syntax
object.Remove Ctrl
Part |
Description |
object |
Required. CSmartSize object. |
Ctrl |
Required. Control to be removed. |
Resize method
Resizes all controls in the resize collection.
Syntax
object.Resize
Part |
Description |
object |
Required. CSmartSize object. |
Examples
The following examples show the effect of the various movement constants.
Original form
After resizing
obj.Add Text3, Me, rsNone, rsNone, rsFix, rsRel
After resizing
obj.Add Text2, Me, rsNone, rsNone, rsFix, rsFix
obj.Add Text3, Me, rsNone, rsFix, rsFix, rsFix
After resizing
obj.Add Text2, Me, rsNone, rsNone, rsFix, rsFix
obj.Add Text3, Me, rsFix, rsFix, rsFix, rsFix