Solved

FindControl(GetFocus)

Posted on 2000-03-21
3
875 Views
Last Modified: 2008-03-03
Hello.

I have some problems with this..
The GetFocus should return the handle for the Currently activated control right?

But if the currently Active control is a TComboBox then the handle returned isn't the Correct handle.

any ideas why this happens...it seems to work just fine if the handle is from a TEdit for instance.

Any tips are appreciated.

//raidos
0
Comment
Question by:raidos
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
simonet earned 50 total points
ID: 2639843
>But if the currently Active control is a TComboBox

The handle is correct. It just happens that it returns the handle for the internal TEdit control that is inside the TComboBox.

The TComboBox control is, as its name suggests, a combo: a mix of a TEdit control and a drop-down listbox control. The handle returned by GetFocus() is for the TEdit.

Alex
0
 
LVL 3

Author Comment

by:raidos
ID: 2639959
Thanks for your comment Alex
Ohhh, I see...

Well that brings me to the next problem then.

When using FindControl(GetFocus) and Active control is a ComboBox then FindControl will return NIL.

Any ideas why that is and how do we solve that?

//raidos

0
 
LVL 3

Author Comment

by:raidos
ID: 2640122
As a result of your Comment Alex i have found the solution on my own.

I will award you the points!

Thanks alot!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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 I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

828 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