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

x
?
Solved

Catch Focus of Edit

Posted on 1998-11-09
2
Medium Priority
?
151 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 40 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

783 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