Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 920
  • Last Modified:

FindControl(GetFocus)

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
raidos
Asked:
raidos
  • 2
1 Solution
 
simonetCommented:
>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
 
raidosAuthor Commented:
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
 
raidosAuthor Commented:
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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now