Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Component name thingy

Posted on 2003-11-11
2
Medium Priority
?
201 Views
Last Modified: 2010-04-05
Hi there,

I have an App that uses an ini file, and this app has approximately 200 small panels on the main form. This is to monitor NT Services over the network, and it is working well. All I would like to change now is the fact that if I read from the ini file, I get back a colour for a service - Service122 for instance and then have to say :  if ..... then pnlServ122.Color := clGreen, etc.
I have tried to concatinate the "pnlServ" and "122" but then Delphi does not see it as a component. Is there another easier way to read a component name from an ini file and use it ?

Yo, I really hope this question make sense ?!

Thanks !!

Pieter
0
Comment
Question by:PieterJ
[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
2 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 1000 total points
ID: 9728698
var
  p : TPanel;
begin
  p := findcomponent('pnlServ122');
  if (assigned(p))  and (p is TPanel) then
    p.color := clgreen;
end;

meikl ;-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9728702
maybe also this way

var
  p : TComponent;
begin
  p := findcomponent('pnlServ122');
  if (assigned(p))  and (p is TPanel) then
    TPanel(p).color := clgreen;
end;

meikl ;-)

0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

688 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