Solved

FindControl(GetFocus)

Posted on 2000-03-21
3
862 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now