Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Active control question
#2
Hi Guys,

As there have been no replies to this question, I take it it is either a very trivial question, which everybody with just the slightest Delphi knowledge should know about and therefore no one feel its necessary to comment or propose solutions, or it is a very complicated issue, possibly impossible, or at least something no one else seem to need (or know about) a solution to.

Well, because I use javascript to activate the OnClick event of a button when hitting a certain key on the keyboard, I need it and now I've found an alternative, at least to the part of knowing which control is the active one, when the OnClick event is fired:

I've created a global (on form level) variable called ActCon.
I've assigned a unique value to the tag property of the edit controls I want to check, and to the tag property of the button.
I've created ONE common OnEnter event for all the Edit controls, and the button, in which I assign the tag value of the "sender" to the global var ActCon.
In the OnClick event of the button, I check the value of ActCon and then know which control has focus when the OnClick event i fired, and can take appropriate action.

NB! I'll be happy to make a small test program if anybody will want an actual example.

Regards
Soren
Reply


Messages In This Thread
Active control question - by SorenJensen - 08-15-2019, 02:58 PM
RE: Active control question - by SorenJensen - 12-09-2019, 09:19 AM
RE: Active control question - by zsleo - 12-09-2019, 06:43 PM
RE: Active control question - by SorenJensen - 12-10-2019, 01:08 PM
RE: Active control question - by kudzu - 12-12-2019, 02:34 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)