Recent

Author Topic: Unable to change color  (Read 8983 times)

Lazzarone

  • Newbie
  • Posts: 5
Unable to change color
« on: November 27, 2006, 11:33:41 am »
Hi to all.
I use Lazarus 0.9.20 with Win XP and I want to draw a red line on a form but the designed line is always black.
Code is
  Form1.Canvas.color :=clRed;
  Form1.Canvas.MoveTo(50,50);
  form1.Canvas.LineTo(100,100);
Thanks.
Lazzarone

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
RE: Unable to change color
« Reply #1 on: November 27, 2006, 11:50:22 am »
Use
Code: [Select]
Form1.Canvas.Pen.color :=clRed; to change the color of the line.

Lazzarone

  • Newbie
  • Posts: 5
RE: Unable to change color
« Reply #2 on: November 27, 2006, 01:50:42 pm »
Thanks Vincent

Lazzarone

  • Newbie
  • Posts: 5
RE: Unable to change color
« Reply #3 on: November 27, 2006, 01:57:53 pm »
Thanks Vincent

 

TinyPortal © 2005-2018