Look at the code below, and try to guess what the message box will contain when you type something into the entryfield and press Enter.
f = new Myform()
f.open()
***********
class Myform of form
this.Entryfield1 = new entryfield(this)
this.Entryfield1.onChange := class::entryfield1_onChange
function Entryfield1_onchange
form.xyz(this)
return
function xyz( oEntryField )
msgbox( oEntryField.className,
'surprise!' )
return
endclass
Once you've made your guess, type
this in Command window: modify command
dQuiz2
Paste the code above into the
program editor, and press F2 to run it. Type something in the entryfield,
and press Enter. Did you guess correctly?
Click here for the answer and an explanation.