ComboBox - problem with Focused method

Posted on 2003-03-24
Medium Priority
Last Modified: 2010-04-04
When I use a ComboBox in my program, the Focused method does not seem to pick up that the component has focus. I used an Edit component before, which worked perfectly (picking up the focus status through the Focused method), but then had to change to a ComoboBox. Now the Focused method always returns False.

Any ideas?
Question by:wyngaard
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 27

Accepted Solution

kretzschmar earned 60 total points
ID: 8194701
what about to lookup the activcontrol-property of your form?

Expert Comment

ID: 8195267
I think that the focused property of the Combobox work fine, try this example:

procedure TForm1.Button1Click(Sender: TObject);
if Combobox1.Focused then
ShowMessage('I have focus.');

Best Regards

"Congratulations Meik for your first position"
LVL 27

Expert Comment

ID: 8195305
>Congratulations Meik for your first position
thanks, marcos,
go here to teh official gratulations thread ;-)

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 8195464
Thanks for the lateral thinking - checking the ActiveControl property of the form works without a problem.

I would still like to know why the Focused method does not work and if anyone has come up with a fix for this.
LVL 27

Expert Comment

ID: 8195502
as marcos confirmed it should work also with a combobox,
there must be a information, which is missed here.

do you adjust any properties?
or are there any events triggered,
before the focus is gained on the combobox?

thanks for the points :-))
glad that this helps you

meikl ;-)

Author Comment

ID: 8195804
I tried marcos's test, and it fails (no message pops up).

I think the missing information might be that I am working in Delphi 3 - this bug might have been fixed in later versions of Delphi.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question