[Lazarus] TBitBtn with Kid=bkClose and ModalResult

Bart bartjunk64 at gmail.com
Sun Apr 22 12:39:35 CEST 2012


On 4/22/12, Hans-Peter Diettrich <DrDiettrich1 at aol.com> wrote:
>  From D7 help:
>  >>
> TModalResult represents the value returned by a modal dialog. An
> application can use any integer value as a modal result value.
> <<
>
> I.e. one can define mrClose and assign it to the close button's
> ModalResult. But this won't help, when the button logic doesn't use the
> ModalResult when Kind=bkClose.

Lazarus treats this as a special case (bkClose), but does Delhi also?

If you have a modern Delphi (as in higher then D3) could you please test this.
Put a TBitBtn on a form.
Set Kind = bkClose (in OI)
Set Modalresult = mrClose (in OI)
ShowModal this form
Click on this TBitBtn
What is the value Modalresult: mrCancel or mrClose?

Bart




More information about the Lazarus mailing list