Using the DEFAULT clause on creating a button from code does not seem to work .. Default is on the Cancel button, not on OK ..
Rick Lipkin
Consider this code:
- Code: Select all Expand view
#Include "FiveWin.ch"
Static cSAY,oSay
//---------------
Func Main()
LOCAL oBtn1,oBtn2,oDlg
cSay := Space(30)
DEFINE DIALOG oDlg ;
FROM 10, 2 to 30, 55 ;
TITLE "DEFAULT Button Test" ;
STYLE nOr( WS_POPUP,WS_CAPTION,WS_THICKFRAME )
@ 3,3 Say oSay var cSay of oDlg
@ 6,16 BUTTON oBtn1 Prompt "&Ok" ;
SIZE 30,25 of oDLG ;
ACTION ( nil )
@ 6,23 BUTTON oBtn2 Prompt "&Cancel" ;
SIZE 30,25 of oDLG ;
ACTION ( oDlg:END() ) DEFAULT
ACTIVATE DIALOG oDlg