Solved

Catch Focus of Edit

Posted on 1998-11-09
2
142 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
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now