See the bellow example.
Type a number inside the textbox and press f2.The odlg:bkeydown is fired by I don't get the value of nFld item.I have to press f2 twice to see the value .Is there a solution for that?
Example:
#include "fivewin.ch"
function main()
local oDlg,nFld:=0
define dialog oDlg ;
from 10,10 to 100,200 pixel
@ 0,0 get nFld size 50,14 pixel of oDlg
oDlg:bkeydown:={|nKey,nFlag|if (nKey==113,msginfo(nFld),nil)}
activate dialog oDlg
return ""
bKeydown Dialog
Re: bKeydown Dialog
ask wrote:See the bellow example.
Type a number inside the textbox and press f2.The odlg:bkeydown is fired by I don't get the value of nFld item.I have to press f2 twice to see the value .Is there a solution for that?
Example:
#include "fivewin.ch"
function main()
local oDlg,nFld:=0
define dialog oDlg ;
from 10,10 to 100,200 pixel
@ 0,0 get nFld size 50,14 pixel of oDlg
oDlg:bkeydown:={|nKey,nFlag|if (nKey==113,msginfo(nFld),nil)}
activate dialog oDlg
return ""
As i can see you can change the above to:
#include "fivewin.ch"
function main()
local oDlg,nFld:=0,oFld
define dialog oDlg ;
from 10,10 to 100,200 pixel
@ 0,0 get oFld var nFld size 50,14 pixel of oDlg
oDlg:bkeydown:={|nKey,nFlag|if (nKey==113,(oFld:oGet:Assign(),msginfo(nFld)),nil)}
activate dialog oDlg
return ""
But i don't thing that it's the best solution
- Antonio Linares
- Site Admin
- Posts: 37485
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact: