The Code is bascially the same for both except for a few variations:
[Code Textbox]
***** VFP9 with SP 1
PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.Show
RETURN
**************************************************
*-- Form: form1 (\imaginecorp\form11.scx)
*-- ParentClass: form
*-- BaseClass: form
*-- Time Stamp: 02/02/07 12:34:08 AM
*
DEFINE CLASS form1 AS form
Top = 3
Left = 48
Height = 100
Width = 375
DoCreate = .T.
ShowTips = .T.
Caption = "Display Value of TextBox..."
Name = "Form1"
ADD OBJECT command1 AS commandbutton WITH ;
Top = 67, ;
Left = 278, ;
Height = 27, ;
Width = 84, ;
Caption = "Close", ;
Name = "Command1"
ADD OBJECT text1 AS textbox WITH ;
ControlSource = "customer.company", ;
Height = 23, ;
Left = 125, ;
MousePointer = 14, ;
SelectOnEntry = .T., ;
Top = 21, ;
Width = 116, ;
Name = "Text1"
ADD OBJECT label1 AS label WITH ;
AutoSize = .T., ;
Caption = "Company", ;
Height = 17, ;
Left = 60, ;
Top = 25, ;
Width = 55, ;
Name = "Label1"
ADD OBJECT command2 AS commandbutton WITH ;
Top = 67, ;
Left = 182, ;
Height = 27, ;
Width = 84, ;
Caption = "Next", ;
Name = "Command2"
PROCEDURE Load
If Used("customer")
Use In customer
Endif
Select 0
Use Home()+"samples\data\customer.dbf"
ENDPROC
PROCEDURE command1.Click
USE IN customer
thisform.release
ENDPROC
PROCEDURE text1.MouseEnter
Lparameters nButton, nShift, nXCoord, nYCoord
If !Empty(This.Value) And Vartype(This.Value) = "C"
nSize = Fontmetric(6,This.FontName,This.FontSize)
If ((Len(Alltrim(This.Value))*nSize)+nSize) > This.Width
This.ToolTipText = Alltrim(This.Value)
Endif
Endif
ENDPROC
PROCEDURE text1.Init
With This
*set the input mask
If Vartype(.Value) = "C" And Empty(.InputMask)
.InputMask = Replicate("X",Fsize(Justext(.ControlSource)))
Endif
Endwith
ENDPROC
PROCEDURE command2.Click
Select customer
If Not Eof()
Skip 1
Endif
Thisform.Refresh
ENDPROC
ENDDEFINE
*
*-- EndDefine: form1
[/code]
[Code Combobox]
***** VFP9 with SP 1
PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.Show
RETURN
**************************************************
*-- Form: form1 (\imaginecorp\form11.scx)
*-- ParentClass: form
*-- BaseClass: form
*-- Time Stamp: 02/02/07 01:02:12 AM
*
DEFINE CLASS form1 AS form
Top = 3
Left = 48
Height = 100
Width = 375
DoCreate = .T.
ShowTips = .T.
Caption = "Display Value of ComboBox"
Name = "Form1"
ADD OBJECT command1 AS commandbutton WITH ;
Top = 67, ;
Left = 278, ;
Height = 27, ;
Width = 84, ;
Caption = "Close", ;
Name = "Command1"
ADD OBJECT label1 AS label WITH ;
AutoSize = .T., ;
Caption = "Company", ;
Height = 17, ;
Left = 60, ;
Top = 25, ;
Width = 55, ;
Name = "Label1"
ADD OBJECT combo1 AS combobox WITH ;
RowSourceType = 6, ;
RowSource = "customer.company", ;
Height = 24, ;
Left = 123, ;
Top = 21, ;
Width = 134, ;
Name = "Combo1"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.