Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to prevent my button to get focused????

99 views
Skip to first unread message

Michael Andersen

unread,
May 11, 1999, 3:00:00 AM5/11/99
to
Is it possible to prevent my button to receive focus?

I have made a button with the property CanFocus and I need to prevent the
button to receive focus if this property is false, then component is based
on a TWinControl.

Regards From

Michael Andersen
Denmark.


Michael Andersen

unread,
May 11, 1999, 3:00:00 AM5/11/99
to

Rob Kennedy

unread,
May 11, 1999, 3:00:00 AM5/11/99
to
Michael Andersen <m...@post2.tele.dk> wrote in message
news:7h8cqk$na...@forums.borland.com...

> Is it possible to prevent my button to receive focus?

Disable it. Button1.Enabled := False;

> I have made a button with the property CanFocus and I need to prevent the
> button to receive focus if this property is false, then component is based
> on a TWinControl.

If you really don't want your button to receive focus, try using a
TSpeedButton instead. They work like TToolButtons. However, keep in mind
that your button cannot be pushed by tabbing to it and pushing the space
bar, which is what some power-users do who don't want to bother with the
work invoved in moving the mouse.

--Rob

Michael Andersen

unread,
May 11, 1999, 3:00:00 AM5/11/99
to
Any other ideas I need to use the button as a combination of a speed button
and a normal button. therefore I cannot disable it.

Rob Kennedy <kenne...@NOSPAMhotmail.com> skrev i en
nyhedsmeddelelse:7h8gpp$nj...@forums.borland.com...

Eddie Shipman

unread,
May 13, 1999, 3:00:00 AM5/13/99
to
Does it have a TABSTOP property? If so, set it to false.
And also write a handler to handle the WM _SETFOCUS
and WM_ACTIVATE messages. WM_SETFOCUS gets
called AFTER the control receives focus. WM_ACTIVATE
is sent when a window is being activated or deactivated but
0 new messages