[Lazarus] Setting ModalResult

Richard Mace richard at shrinkyourbills.co.uk
Tue Mar 13 07:50:47 CET 2012


On 12 March 2012 23:51, Mattias Gaertner <nc-gaertnma at netcologne.de> wrote:

> On Mon, 12 Mar 2012 23:40:31 +0000
> Richard Mace <richard.mace at gmail.com> wrote:
>
> > Hi All,
> > I have my main form, performing the following code:
> >
> > if frmLogIn.ShowModal = mrOk then
> > begin
> >   ShowMessage('OK was clicked');
> > end
> >
> > Now, if at design time on my frmLogIn I have a btnOK.ModalReult := mrOk,
> > when btnOK is clicked, the form closes and the above result is true.
> > However, if at design time, on my frmLogIn I have btnOK.ModalResult :=
> > mrNone, and then on the btnOK.OnclickEvent I set the ModalResult := True,
> > the frmLogIn does not close, but it does set the ModalResult to mrOK,
> > however, I have to click the btnOK button for a second time for the form
> to
> > close. The same code is Delphi 7 set's the ModalResult to OK AND closes
> the
> > form.
>
> It works here.
>
>
> > Is this a bug, or am I missing something?
> >
> > Thanks in advance
> >
> > Richard
> >
> > Lazarus 0.9.30 fpc 2.4 Windows XP
>
> 2.4?
> Please check these versions. They look pretty old.
>
>
Thanks Mattias.
Yes, I had just installed the latest "released" binaries for both Lazarus
and FPC.
I'm now attempting to install from SVN trunk.

Thanks again

Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20120313/618fdd9c/attachment-0003.html>


More information about the Lazarus mailing list