?
Solved

Changing color during focus changing

Posted on 2000-01-25
3
Medium Priority
?
173 Views
Last Modified: 2010-04-04
I want changing color to component during editing when it receives focus but with one event not by an event for component. I have a form with +30 components; I don't like copy/paste ...
0
Comment
Question by:g_iannetti
3 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 280 total points
ID: 2387007
hi
there is 2 options :

1:
you hold down shift while selecting all the components then can edit all components properties at once..

or
2:

somewhee on your form hold down the left mouse button and drag mouse around form making the "rubberband effect" which selects all components at once then edit all at once in object inspector.
the same as selecting many icons on your desktop at once ..

Regards Barry
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 2387030
You could write a single onEnet and OnExit handler and assign them to all the components. Then you can do this:

procedure TMyForm.GenericOnEnter(Sender : TObject);
begin
  if Sender is TControl then
    (Sender as TControl).Color := clPink; // or whatever
end;

And the same for the OnExit:

procedure TMyForm.GenericOnExit(Sender : TObject);
begin
  if Sender is TControl then
    (Sender as TControl).Color := clYellow; // or whatever
end;

Cheers,

Raymond.

0
 

Author Comment

by:g_iannetti
ID: 2387050
Thank you for fast answer.
If I understand I have to write the two procedures only ?!
Fantastic !

Tahnk you again.
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
There may be issues when you are trying to access Outlook or send & receive emails or due to Outlook crash which leads to corrupt or damaged PST file. To eliminate the corruption from your PST file, you need to repair the corrupt Outlook PST file. U…
Watch the video to learn how one can deal with PST file corruption issue with an outstanding Kernel for Outlook PST Repair Tool easily. Using this tool, non-technical users can swiftly perform the repair process to restore their essential data witho…
Suggested Courses

588 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