Solved

FindControl(GetFocus)

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

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…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

751 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