Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread TGradientColorStops at run-time?
Mon, May 16 2016 9:59 AMPermanent Link

Trinione

How to set the background fill progmatically?
Mon, May 16 2016 10:03 AMPermanent Link

Trinione

No reply necessary if the following is correct:


 Panel1.Background.Fill.FillType := ftGradient;
 with Panel1.Background.Fill.Gradient do
 begin
   GradientType := gtLinear;
   ColorStops.ColorStop[0].Position := 0;
   ColorStops.ColorStop[0].Color := clWhite;
   ColorStops.ColorStop[1].Position := 100;
   ColorStops.ColorStop[1].Color := clBlue;
 end;
Mon, May 16 2016 10:06 AMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

Try this:

with TempPanel.Background.Fill.Gradient.ColorStops.Add do
  Color := clTransparent;
  with TempPanel.Background.Fill.Gradient.ColorStops.Add do
  begin
    Position := 100;
    Color := clCornSilk;
  end;


Chris Holland
[Team Elevate]

On 16/05/2016 14:59, Trinione wrote:
> How to set the background fill progmatically?
>
Tue, May 17 2016 12:25 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

<< No reply necessary if the following is correct: >>

Chris's example is correct - you need to use the Add method, otherwise you're referencing color stops that don't exist yet:

http://www.elevatesoft.com/manual?action=viewcomp&id=ewb2&comp=TGradientColorStops

Tim Young
Elevate Software
www.elevatesoft.com
Image