VB Layout 1.32
==============
                          
VBLAYOUT.OCX by Paul Wannbaeck (pwk@hem1.passagen.se)

Freeware. Freely distributable.

Purpose
=======
ActiveX control for Visual Basic. Resizes and moves selected controls as
specified when the form is resized. Saves some time off the tedious Form_Resize
coding.

Files:
======
VBLAYOUT.OCX	The VB Layout ActiveX control
README.TXT		This file.
DEMO5.ZIP		VB 5 Demo project with exe & source. Requires VB 5 runtime DLL.
DEMO6.ZIP       VB 6 Demo project with exe & source. Requires VB 6 runtime DLL.

Requirements
============
Win95/NT. MS Visual Basic 32 bit. Has been tested with VB 5 & 6 in Win95 and NT4.0

Revision history
================
1.32    VB crashed when terminating an app with more than 8 MDI windows containing VB Layout.
		This can be a VB6 bug, but it helped to remove AddRef/Release on the IDispatch given
		in the AddControl call.
1.31    If size was rapidly decreased to original or less than original, VB Layout didn't
		restore to original control size & placement.
1.3		Now works with controls contained in a MS Tabbed Dialog (SSTab). The SSTab 
		Control hides controls in non-active tabs by moving them left 75000 units. VB
		Layout is now aware of this.
1.2A	Corrected documentation and demo bug regarding MDI childs
1.2		Fixed minor bug when calling OnSize without any controls added.
		256 control limitation removed.
		Enhanced documentation. Demo VB project.
1.1		First version on the Net.
1.0		The first version

Installation
============
Copy the file VBLAYOUT.OCX to an appropriate location. Register it with regsvr32
or through Visual Basic (Components->Browse...).

Feedback & bug reports
======================
Email: pwk@hem1.passagen.se

Documentation
=============
This Visual Basic control saves some time off the tedious coding in
Form_Resize.

Just add the layout manager to the form, add the managed controls to it 
(LayoutMgr1.AddControl) in Form_Load and call LayoytMgr1.OnSize in Form_Resize.

When the first AddControl is called, the layout manager records the form size
and uses that size as a base for resizing. 

Methods:
========

AddControl(Control as Object, xMove as Double, yMove as Double, xSize as Double, ySize as Double)
	Adds a control to the layout manager. The original position and size of the
	control is recorded as a base for resizing. 

	The xMove,yMove,xSize and ySize parameters should be assigned a value between 0.0 and 1.0.

	Parameters:
		Control		The control to add
		xMove		x movement. New control.Left = original control.Left + xMove * (new formwidth - old formwidth)
					0.0 = no movement
					0.5 = 50 % movement
					1.0 = 100 % movement
		yMove		y movement. New control.Top = original control.Top + yMove * (new formheight - old formheight)
					0.0 = no movement
					0.5 = 50 % movement
					1.0 = 100 % movement
		xSize		x sizing. New controlwidth = original controlwidth + xSize * (new formwidth - old formwidth)
					0.0 = no sizing
					0.5 = 50 % sizing
					1.0 = 100 % sizing
		ySize		y sizing. New controlheight = original controlheight + ySize * (new formheight - old formheight)
					0.0 = no sizing
					0.5 = 50 % sizing
					1.0 = 100 % sizing
		

OnSize()
	Moves and resizes the controls as specified.

Properties:
===========
None

Runtime:
========
Invisible

A note regarding MDI Child Windows:
===================================
VB Layout records the form size when the first control is added. For dialogs,
this is normally the design time form size. MDI Child form initial size can be
other than the design time size. To make VB Layout work correctly, reset
the form size to the design time size before adding the first control.
Example:
	Form_Load()
		.
		.
		oldWidth = Width
		oldHeight = Height
		Width = 3500;
		Height = 4500;
		LayoutMgr1.AddControl List1, 0, 0, 0.5, 1
		.
		.
		LayoutMgr1.AddControl Button59, 0, 0, 0.5, 1
		Width = oldWidth
		Height = oldHeight
		.
		.
The Demo project (see below) uses this method.

Demo VB project:
================
VB 5 Demo with exe & source in DEMO.ZIP

Example:
========

Test this example:

Design a form with:
	a layout manager
	a listbox List1 in upper left corner (disable integral height, it behaves better)
	a button  Command1 in upper right corner
	a button  Command2 in lower right corner
	a button  Command1 in lower left corner

Form_Load
	LayoutMgr1.AddControl List1, 0, 0, 1, 1
	LayoutMgr1.AddControl Command1, 1, 0, 0, 0
	LayoutMgr1.AddControl Command2, 1, 1, 0, 0
	LayoutMgr1.AddControl Command3, 0, 1, 0, 0

Form_Resize
	LayoutMgr1.OnSize

Miscellaneous:
==============
VB Layout was written in MS C++ using MS ATL (Active Template Library).
