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

x
?
Solved

Labels -  Show/Hide

Posted on 1999-06-27
2
Medium Priority
?
318 Views
Last Modified: 2012-05-04
I have several labels on a form and I am hiding all then showing all at various times. How can I set this up so I only make one call to all labels rather than Label1.Hide; Label2.Hide; etc. I've tried  with Sender as TLabel but I keep getting error messages.

Cheers
xpher
0
Comment
Question by:xpher
[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 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 80 total points
ID: 1384781
hi,
do like this:

procedure TForm1.Button1Click(Sender: TObject);
Var
i:integer;
begin
  for i := 0 to ComponentCount-1 do
    begin
      if( Components[ i ] is TLabel )then
      begin
        (Components[ i ] as TLabel).Visible:= False;
      end;
 end;
  end;


Regards Barry

0
 
LVL 1

Author Comment

by:xpher
ID: 1384782
Many thanks Barry

Chris :))
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
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

671 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