Solved

Catch Focus of Edit

Posted on 1998-11-09
2
148 Views
Last Modified: 2010-04-04
Is is possible receive some Notification when an EditBox is activated at run-time, either thru a Mouse Click of it or using the Tab Key ?
0
Comment
Question by:omsec
[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 Comments
 
LVL 1

Accepted Solution

by:
zac earned 10 total points
ID: 1346253
You can use the OnEnter event to capture the activation and onExit as focus is lost from the control.  However the OnEnter event does not occur when switching between forms or between another Windows application and the application that includes the windowed control.

I hope this helps

Zac
0
 
LVL 1

Expert Comment

by:rpetruni
ID: 1346254
I use this one for coloring active control:

procedure TForm1.FormCreate(Sender: TObject);
begin
     Screen.OnActiveControlChange:=ColorControl;
end;

procedure TForm1.ColorControl(Sender: TObject);
var
  I : Integer;
  Forma: Tform1;
begin
  for I:= 0 to Forma.ControlCount -1 do
   begin
    if (Forma.Controls[I] is TWinControl) then
    begin
      if (Forma.Controls[I] as TWinControl).Focused then
      TEdit(Forma.Components[I])as TWinControl).color:=clWindow
      else
      TEdit(Forma.Components[I]).color:=clBtnFace;
    end;
   end;
end;

Any control wich is focused is colored in clWindow...
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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

728 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