Board index » delphi » Showmodal problem

Showmodal problem

Hi!

When i do a

form2.showmodal;

my form comes up...
But when the user presses enter, it automatically presses OK. (even if its
not focused)
And I don't want that... Anyone know how to avoid it?

Thanks,
Richard.Fu...@interkodex.no

 

Re:Showmodal problem


Change MrResult of the OK button

Richard Funke heeft geschreven in bericht ...

Quote
>Hi!

>When i do a

>form2.showmodal;

>my form comes up...
>But when the user presses enter, it automatically presses OK. (even if its
>not focused)
>And I don't want that... Anyone know how to avoid it?

>Thanks,
>Richard.Fu...@interkodex.no

Re:Showmodal problem


If the OK button  isn't the only button on the form you could change
Form2.ActiveControl := ButtonDoNothing;
If u don't have another button the  form u can either make one and set it's
visible to false,or (better) set the activecontrol to another component such
as a panel,image etc.
Scotter.

Quote
Richard Funke <richard.fu...@interkodex.no> wrote in message

news:Ek4I3.1068$A_5.8547@news1.online.no...
Quote
> Hi!

> When i do a

> form2.showmodal;

> my form comes up...
> But when the user presses enter, it automatically presses OK. (even if its
> not focused)
> And I don't want that... Anyone know how to avoid it?

> Thanks,
> Richard.Fu...@interkodex.no

Re:Showmodal problem


Quote
Richard Funke wrote:

> Hi!

> When i do a

> form2.showmodal;

> my form comes up...
> But when the user presses enter, it automatically presses OK. (even if its
> not focused)
> And I don't want that... Anyone know how to avoid it?

This happens if the OK Button has the property Default set.

-Michael

Re:Showmodal problem


You also can set the "Default" property of the "OK" button to "False" if you
don't want that the form closes when the user press "Enter" anytime else the
button is focused.

[]'s

Jair Roberto Nunes da Silva
j...@microflex.com.br

Quote
Loopy <lo...@sscotter.freeserve.co.uk> wrote in message

news:7sqvb7$8ce$1@news4.svr.pol.co.uk...
Quote
>If the OK button  isn't the only button on the form you could change
>Form2.ActiveControl := ButtonDoNothing;
>If u don't have another button the  form u can either make one and set it's
>visible to false,or (better) set the activecontrol to another component
such
>as a panel,image etc.
>Scotter.

>Richard Funke <richard.fu...@interkodex.no> wrote in message
>news:Ek4I3.1068$A_5.8547@news1.online.no...
>> Hi!

>> When i do a

>> form2.showmodal;

>> my form comes up...
>> But when the user presses enter, it automatically presses OK. (even if
its
>> not focused)
>> And I don't want that... Anyone know how to avoid it?

>> Thanks,
>> Richard.Fu...@interkodex.no

Re:Showmodal problem


Is TButton.default=true?

Matija

Re:Showmodal problem


Check in the properties of the OK button. Set Default property to false'
Hope it helps
Quote
Richard Funke wrote in message ...
>Hi!

>When i do a

>form2.showmodal;

>my form comes up...
>But when the user presses enter, it automatically presses OK. (even if its
>not focused)
>And I don't want that... Anyone know how to avoid it?

>Thanks,
>Richard.Fu...@interkodex.no

Other Threads