Solved

FindControl(GetFocus)

Posted on 2000-03-21
3
887 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
[X]
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
  • 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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month3 days, 23 hours left to enroll

630 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