Share via


Line (Control: propiedades, métodos y eventos)

Propiedades

Application BaseClass BorderColor
BorderStyle BorderWidth Class
ClassLibrary ColorSource (Propiedad) Comment
DragIcon DragMode DrawMode
Enabled Height HelpContextID
Left LineSlant MousePointer
Name OLEDragMode OLEDragPicture
OLEDropEffects OLEDropHasData (Propiedad) OLEDropMode
Parent ParentClass Tag
Top Visible WhatsThisHelpID
Width    

Eventos

Click DblClick Destroy
DragDrop DragOver Error
Init MiddleClick (Evento) MouseDown
MouseEnter MouseLeave MouseMove
MouseUp MouseWheel OLECompleteDrag
OLEDragDrop OLEDragOver OLEGiveFeedBack
OLESetData OLEStartDrag RightClick
UIEnable    

Métodos

AddProperty CloneObject Drag
Move OLEDrag ReadExpression
ReadMethod ResetToDefault SaveAsClass
WriteExpression WriteMethod ZOrder

Ejemplo

El ejemplo siguiente demuestra la forma de agregar un control Line a un formulario y el posible uso de la propiedad LineSlant para especificar la dirección en que se desea inclinar la línea.

El método AddObject se utiliza para agregar un control Line a un formulario. Se agregan tres botones de comando al formulario, que permiten cambiar la dirección en que se inclina la línea y cerrar el formulario.

frmMyForm = CREATEOBJECT('Form')  && Create a Form
frmMyForm.Closable = .F.  && Disable the Control menu box 

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

Line (Control) | Line (Método) | LineSlant (Propiedad)