RE:Como añadir controles a un formulario desde cod
Estudia Crete form
luego add object
y para las cantidades utiliza for each y lparameters
este ejemplo esta en la ayuda de foxpro
DEFINE CLASS EasyForm AS FORM
* Here's a pretty basic form that auto-centers, has a Close
* button and lets you pass it a background color and a window
* caption.
AutoCenter = .T.
ADD OBJECT cmdClose AS CloseButton
PROCEDURE Init(nBackColor, cCaption)
IF TYPE("nBackColor") = "N"
This.BackColor = nBackColor
ENDIF
IF TYPE("cCaption") = "C"
This.Caption = cCaption
ENDIF
This.cmdClose.Left = (This.Width - This.cmdClose.Width) /2
This.cmdClose.Top = This.Height - This.cmdClose.Height ;
- 10
ENDPROC
ENDDEFINE
DEFINE CLASS PassForm AS EasyForm
* This is a subclass of our basic form above. It insists on
* being passed a built-in password or you can't create it. Not
* exactly user-friendly, is it?
PROTECTED cPassWord
cPassWord = "Yowza!"
PROCEDURE Init(nBackColor, cCaption, cPass)
IF TYPE("cPass") = "C" AND cPass = This.cPassWord
DoDefault(nBackColor, cCaption)
ELSE
RETURN .F.
ENDIF
ENDPROC
ENDDEFINE
DEFINE CLASS CloseButton AS CommandButton
* Standard Close button. Caption is "Close" and it releases the
* form when clicked.
Name = "cmdClose"
Caption = "Close"
Height = 40
Width = 60
PROCEDURE Click
ThisForm.Release()
ENDPROC
ENDDEFINE