CreateTextField( x,y,width,height,group[,style])

Parameters

x,y,width,height - Initial shape of the textfield gadget.
group - Group the text textfield belongs to.
style - 0 for normal, 1 for password masking

Description

CreateTextField creates a textfield gadget and returns a handle to it.

Textfield gadgets allow the user to enter a single line of text.

To 'preload' the textfield with some initial text, use SetGadgetText.

Textfields generate gadget action events whenever the user types enters a character into the gadget.
When a gadget action event from a textfield occurs, the EventData function can be used to determine
the ascii code of the character typed.

See also: TextFieldText.

Example

; TextFieldText Example by Mag

win=CreateWindow ("",0,0,300,100) ;create window
txtbox=CreateTextField(0,0,200,20,win) ;create textfield in that window
SetGadgetText txtbox,"Type anything and press OK" ;set text in that textfield for info
ok=CreateButton("OK",200,0,80,20,win) ;create button

Repeat
id=WaitEvent() ;wait for user action (in a form of event)
If id=$803 Then End ;to quit program when we receive Window close event
If id=$401 And EventSource()=ok Then ; when ok is pressed
Notify "This is your text in TextField:"+Chr$(13)+TextFieldText$(txtbox); <---TO GET TEXT FROM TEXTFIELD
End If
Forever
End

Index

Click here to view the latest version of this page online