'Can a TextBox be created that can
'stay in a loop without recreating
'the textbox each time? I want to
'use it to accept input at any position
'on a screen or accept multiple lines
'of input. Also, can this be done without
'the OK and Cancel buttons.
'
If the input is blank (result=0) just terminate.
'
'Any help would be appreciated.
------------------
[This message has been edited by Mike Doty (edited February 27, 2001).]
'stay in a loop without recreating
'the textbox each time? I want to
'use it to accept input at any position
'on a screen or accept multiple lines
'of input. Also, can this be done without
'the OK and Cancel buttons.
'
If the input is blank (result=0) just terminate.
'
'Any help would be appreciated.
Code:
#COMPILE EXE #DIM ALL #INCLUDE "WIN32API.INC" %IDTEXT = 100 %IDOK = 1 %IDCANCEL = 2 %IDTEXT = 100 %BS_DEFAULT = 1 '------------------------------------------------------------------------------ GLOBAL UserName AS STRING CALLBACK FUNCTION OkButton() CONTROL GET TEXT CBHNDL, %IDTEXT TO UserName DIALOG END CBHNDL, 1 END FUNCTION CALLBACK FUNCTION CancelButton() DIALOG END CBHNDL, 0 END FUNCTION '------------------------------------------------------------------------------ FUNCTION PBMAIN () AS LONG #REGISTER NONE LOCAL hDlg AS LONG LOCAL result AS LONG LOCAL answer AS STRING DIM x AS LONG DIM Style AS LONG DIM DEFAULT AS STRING top: ' ** Create a new dialog template DIALOG NEW 0, "Click Cancel to end", ,, 320, 40, 0, 0 TO hDlg ' ** Add controls to it style& = %ES_Center default$ = "" CONTROL ADD TEXTBOX, hDlg, %IDTEXT, Default$, 10, 1, 300, 12, 0 CONTROL ADD BUTTON, hDlg, %IDOK, "OK", 10, 22, 40, 14, %BS_DEFAULT CALL OkButton CONTROL ADD BUTTON, hDlg, %IDCANCEL, "Cancel", 84, 22, 40, 14, 0 CALL CancelButton ' ** Display the dialog DIALOG SHOW MODAL hDlg TO result ' ** Check the result 'IF result THEN MSGBOX UserName IF result THEN GOTO top END FUNCTION
------------------
[This message has been edited by Mike Doty (edited February 27, 2001).]
Comment