ObjectDCL Banner

Control_SetPos Method

Description

This method will move a control to the new specified position.  When repositioning the control, optional width and height parameters can be specified.

Parameters

MyControlReference
Reference to the control in the form of MyProject_MyForm_MyControl.
ProjectFile
String identifying the project as it was passed in LoadProject.
DialogName
String identifying the dialog by name.
ControlName
String identifying the control by name.
Left
Integer specifying the distance from the left side of the dialog.
Top
Integer specifying the distance from the top side of the dialog.
Width
Integer specifying the width of the control.
Height
Integer specifying the height of the control.

Return Values

Returns the following according to the situation:

  • T when successful.
  • Nil if the control is not found.

AutoLISP Syntax

The recommended convention is passing the control identifier directly:

CopyCode imageCopy Code
(Odcl_Control_SetPos 
		MyControlReference [as Reference]
		Left [as Integer] 
		Top [as Integer] 
		[Optional] Width [as Integer] 
		[Optional] Height [as Integer])

An alternative convention is to identify the control by providing the project file, the dialog name and the control name:

CopyCode imageCopy Code
(Odcl_Control_SetPos
		ProjectFile [as String]
		DialogName [as String]
		ControlName [as String]
		Left [as Integer]
		Top [as Integer]
		[Optional] Width [as Integer]
		[Optional] Height [as Integer])

It is possible to update in batch many control by first providing the project file and the dialog name:

CopyCode imageCopy Code
(Odcl_Control_SetPos
		ProjectFile [as String]
		DialogName [as String]
		(ControlName [as String]
			Left [as Integer]
			Top [as Integer]
			[Optional] Width [as Integer]
			[Optional] Height [as Integer])
		[Optional] (ControlName [as String]
			Left [as Integer]
			Top [as Integer]
			[Optional] Width [as Integer]
			[Optional] Height [as Integer])
		...)

Applies For

ActiveX, AngleSlider, Animation, BlockList, BlockView, CheckBox, ComboBox, DwgList, DwgPreview, Frame, GraphicButton, EditableGrid, Grid (Hatch), HtmlControl, ImageCombo, Label, ListBox, ListView, MonthPicker, Option, OptionList, PictureBox, ProgressBar, Rectangle, ScrollBar, SliderBar, SlideView, SpinButton, Splitter, TabControl, TextBox, TextButton, TreeControl, UrlLink.

Example

CopyCode imageCopy Code
; Set the control position
(Odcl_Control_SetPos MyProject_MyForm_MyControl 5 5 200 30)

See Also

Left, Top, Width, Height, Control_GetCurPos, Control_ZOrder