Dialog Buttons (Default)

Dialog Buttons (Default)

I have several dialog boxes that I'm utilizing within an application as "pop-ups" to gatherer input from the user. The boxes were automatically created with OK and CANCEL buttons, which is fine because I use them. My problem is that I don't want any button on the dialog box to be activated by the ENTER key during data input. The OK button always becomes the default button even though I don't have it checked for default in the resource properties. How do I take the default status off of it?

publicaciones de 2 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

What's wrong with using ENTER for OK button?

Well, if you insist, you could make an (invisible) default button yourself. Since DFLOGM automatically closes the dialog on unhandled buttons, you could workaround that behaviour by registering a callback for it:

SUBROUTINE OnMyButton(Dlg, ID, iEvent)
!Either leave it empty, or...
USE DFWIN, ONLY: SendMessage, WM_NEXTDLGCTL

TYPE (Dialog)::  Dlg
INTEGER:: ID, iEvent, iSt

!...include the following line to move focus to
!the next control.
iSt=SendMessage(Dlg%hWnd,WM_NEXTDLGCTL,0,0)

END SUBROUTINE OnMyButton

HTH
Jugoslav

Jugoslav
www.xeffort.com

Deje un comentario

Por favor inicie sesión para agregar un comentario. ¿No es socio? Únase ya