Share via


Left (Propiedad)

Especifica la distancia entre el borde izquierdo de un objeto y su objeto contenedor. Está disponible en tiempo de diseño y en tiempo de ejecución.

Object.Left[ = nDist]

Valores de la propiedad

  • nDist
    Especifica la distancia entre el borde izquierdo de un objeto o formulario y el borde izquierdo del objeto contenedor.

    El contenedor predeterminado para un formulario es la ventana principal de Visual FoxPro.

Observaciones

La propiedad Left especifica a qué distancia de su posición cero se situará el objeto. Por ejemplo, si un formulario está contenido en la ventana principal de Visual FoxPro, la posición cero es justo a la derecha del borde izquierdo de la ventana principal. Si hay una barra de herramientas acoplada a la izquierda de la ventana principal, la posición cero es justo a la derecha de la barra de herramientas. En Visual FoxPro para Macintosh, si el formulario se encuentra en el escritorio (lo que significa que no está contenido en la ventana principal de Visual FoxPro), la posición cero es el límite izquierdo de la pantalla.

Utilice las propiedades Left, Top, Height y Width para operaciones basadas en las dimensiones externas de un objeto, como mover o cambiar el tamaño. Utilice la propiedad ScaleMode para cambiar la unidad de medida.

Nota   La propiedad Left es de sólo lectura cuando se aplica a un control contenido en un objeto Column.

Ejemplo

El ejemplo siguiente demuestra el uso de la propiedad Left para colocar controles en un formulario. El método AddObject se utiliza para agregar un control Line y tres botones de comando al formulario y la propiedad Left especifica su ubicación horizontal en el formulario.

frmMyForm = CREATEOBJECT('Form')  && Create a form
frmMyForm.Closable = .F.  && Disable the window pop-up menu
 
frmMyForm.AddObject('shpLine','Line')  && Add a Line control to the form
frmMyForm.AddObject('cmdCmndBtn1','cmdMyCmndBtn1')  && Up Cmnd button
frmMyForm.AddObject('cmdCmndBtn2','cmdMyCmndBtn2')  && Down Cmnd button
frmMyForm.AddObject('cmdCmndBtn3','cmdMyCmndBtn3')  && Quit Cmnd button

frmMyForm.shpLine.Visible = .T.  && Make Line control visible
frmMyForm.shpLine.Top = 20  && Specify Line control row
frmMyForm.shpLine.Left = 125  && Specify Line control column

frmMyForm.cmdCmndBtn1.Visible =.T.  && Up Command button visible
frmMyForm.cmdCmndBtn2.Visible =.T.  && Down" Command button visible
frmMyForm.cmdCmndBtn3.Visible =.T.  && Quit Command button visible

frmMyForm.SHOW  && Display the form
READ EVENTS  && Start event processing

DEFINE CLASS cmdMyCmndBtn1 AS COMMANDBUTTON  && Create Command button
   Caption = 'Slant \<Up'  && Caption on the Command button
   Left = 50  && Command button column
   Top = 100  && Command button row
   Height = 25  && Command button height
   
   PROCEDURE Click
      ThisForm.shpLine.Visible = .F.  && Hide the Line control
      ThisForm.shpLine.LineSlant ='/'  && Slant up
      ThisForm.shpLine.Visible = .T.  && Show the Line control
ENDDEFINE

DEFINE CLASS cmdMyCmndBtn2 AS CommandButton  && Create Command button
   Caption = 'Slant \<Down'  && Caption on the Command button
   Left = 200  && Command button column
   Top = 100  && Command button row
   Height = 25  && Command button height

   PROCEDURE Click
      ThisForm.shpLine.Visible = .F.  && Hide the Line control
      ThisForm.shpLine.LineSlant ='\'  && Slant down
      ThisForm.shpLine.Visible = .T.  && Show the Line control
ENDDEFINE

DEFINE CLASS cmdMyCmndBtn3 AS CommandButton  && Create Command button
   Caption = '\<Quit'  && Caption on the Command button
   Cancel = .T.  && Default Cancel Command button (Esc)
   Left = 125  && Command button column
   Top = 150  && Command button row
   Height = 25  && Command button height

   PROCEDURE Click
      CLEAR EVENTS  && Stop event processing, close form
ENDDEFINE

Vea también

Height (Propiedad) | Move (Método) | ScaleMode (Propiedad) | Top (Propiedad) | Width (Propiedad)

Se aplica a: CheckBox | ComboBox | CommandButton | CommandGroup | Container (Objeto) | Control (Objeto) | Custom | EditBox | Form | Grid | Image | Label | Line | ListBox | OLE Bound (Control) | Contenedor OLE (Control) | OptionButton | OptionGroup | PageFrame | _SCREEN | Shape | Spinner | TextBox | Timer | ToolBar