I am trying to make an edit box that I can type data into and when I hit enter it will transmit the text in the edit box and do a couple of othr things. I can make it work with a push button but I dont want to have ti hit the button every time. Is ther a way to put the focus on the edit box or something? Someone please help.
Here is the sample code:
proc main
dialogbox 0 7 16 672 29 2 "Caption"
editbox 2 20 4 482 20 cmdtext
pushbutton 3 517 5 62 17 "Push"
enddialog
while 1 ; Loop forever.
dlgEvent 0 EventID ; Get dialog EventID.
switch EventID ; Evaluate the EventID.
case 0
endcase
case 2
keyget ikey
if ikey==13
call sndcmd
;usermsg "%d" ikey
endif
endcase
case 3
call sndcmd
endcase
default
exitwhile
endcase
endswitch
endwhile
dlgdestroy 0 CANCEL
endproc
proc sndcmd
;strfmt cmdtxt "%s^M" cmdtxt
transmit cmdtext
transmit "^M"
cmdtext = ""
main ()
endproc
Thanks
Here is the sample code:
proc main
dialogbox 0 7 16 672 29 2 "Caption"
editbox 2 20 4 482 20 cmdtext
pushbutton 3 517 5 62 17 "Push"
enddialog
while 1 ; Loop forever.
dlgEvent 0 EventID ; Get dialog EventID.
switch EventID ; Evaluate the EventID.
case 0
endcase
case 2
keyget ikey
if ikey==13
call sndcmd
;usermsg "%d" ikey
endif
endcase
case 3
call sndcmd
endcase
default
exitwhile
endcase
endswitch
endwhile
dlgdestroy 0 CANCEL
endproc
proc sndcmd
;strfmt cmdtxt "%s^M" cmdtxt
transmit cmdtext
transmit "^M"
cmdtext = ""
main ()
endproc
Thanks