IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
Delphi
Search Delphi Group:

Advanced
-Collapse +Expand Delphi To/From
To/FromCODEGuides
-Collapse +Expand Delphi Store
PRESTWOODSTORE

Prestwood eMagazine

August Edition
Subscribe now! It's Free!
Enter your email:

   ► MB LobbyPascal and Delphi Coding BoardDelphi Single User Apps Topic   Print This     

Delphi -- Search an array for a coloured Tpanel

Delphi -- Search an array for a coloured Tpanel in Delphi Single User Apps topic (part of our Pascal and Delphi Coding group).

Quick Search: coloured   Delphi Search   Delphi Search array   coloured Tpanel  
Tom.L
-- --

I have an array y=11 by x=20 array containing Tpanels they all have corresponding colours assined to them. i would like to be able to search through the arraay to find a cirtian colour and change it to another, i tried this but it didnt work.

procedure TFrmSeatLayout.BtnDeselectAllClick(Sender: TObject);
begin
ListSelectedSeats.Items.Clear; (ignore this)
if ArPnl [x,y].color = clPurple then (the array is called Arpnl)
ArPnl [x,y].color := clTeal;

end; 

I want it to find the Purple panel and change it to Teal

Thanks for your help

Tom

 Posted 7 years ago (Thread Starter)
Comment Quote
About Tom.L -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #14979, 1 replies
Thread Started 1/17/2013 7:13:28 AM
View Counter=3957
Location=-- -- 
Joined=7 years ago   MB Posts=1  
Most Recent Post
Wes Peterson
Prestwood IT
Prestwood IT office in Citrus Heights, CA

Hi Tom,

You don't mention the type of your array, nor if your code produces any errors.

The solution may be as simple as casting your array items to TPanel:

if TPanel(ArPnl [x,y]).color = clPurple then (the array is called Arpnl)
  TPanel(ArPnl [x,y]).color := clTeal;

Wes Peterson
Senior Software Engineer
Prestwood IT Solutions
http://www.prestwood.com

 Posted 7 years ago
Comment Quote
About Wes Peterson -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About Wes Peterson

Wes Peterson is a Senior Programmer Analyst with Prestwood IT Solutions where he develops custom Windows software and custom websites using .Net and Delphi. When Wes is not coding for clients, he participates in this online community. Prior to his 10-year love-affair with Delphi, he worked with several other tools and databases. Currently he specializes in VS.Net using C# and VB.Net. To Wes, the .NET revolution is as exciting as the birth of Delphi.


Post ID #14980 (Level 1.1)  Reply to 14979
Thread Started 1/17/2013 8:55:48 AM
Location=Prestwood IT office in Citrus Heights, CA 
Joined=16 years ago   MB Posts=158   KB Posts=163   KB Comments=34   BLOG, Topics=20  

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1157A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #14979 Counter
3957
Since 1/17/2013
Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2020 Prestwood IT Solutions.   [Security & Privacy]