Placement (Magic xpa 4.x)
The Placement property lets you specify on each control that the control will:
![](/PublicKnowledge/servlet/rtaImage?eid=ka23z0000004Pcm&feoid=00ND0000005rAjf&refid=0EM3z000001reD9)
Entering 100 in Width or Height placement fields means that the control will resize 100% of the stretching of one of the window’s sides; 50 means it will resize half the amount.
Entering 100 in the X or Y placement fields means that the control will move 100% of the stretching of one of the window’s sides.
When resizing the form:
-
Defining values of X=100 and Y=100 will keep the control in the bottom right position. This is mostly used for buttons that should remain in that position, regardless of the size of the form.
-
Defining values of Width=100 will resize the control horizontally. This is mostly used when the control size is smaller than its data can be.
-
Defining values of X=100 will move the control horizontally. This is mostly used when this control is displayed after a control that has a Width placement of 100%.
When a control’s Placement property equals 0, the relative size of the control does not change when the form size changes in runtime. When the Placement property is > 0, the relative size changes when the form size changes in runtime.
Using placement on Table controls gets particularly interesting. When the Height placement on a table is 100%, the table adds rows as it resizes. If the X placement is 100%, the columns resize and stretch so more data is visible.
![](/PublicKnowledge/servlet/rtaImage?eid=ka23z0000004Pcm&feoid=00ND0000005rAjf&refid=0EM3z000001reDA)
|
The controls will never get smaller than their original size. So if you are expecting a form to be resized, create each control at the smallest required size.
|
How Do I Make Form Controls Fit the Form When it Is Resized?