# Line color

**URL:** <https://forum.servoy.com/t/line-color/4258>\
**Category:** Classic Servoy\
**Created:** [May 25, 2005, 7:55pm UTC](https://forum.servoy.com/t/line-color/4258 "2005-05-25T19:55:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ron](https://avatars.discourse-cdn.com/v4/letter/r/ecae2f/32.png) [@Ron](https://forum.servoy.com/u/Ron)\
**Post date:** [May 25, 2005, 7:55pm UTC](https://forum.servoy.com/t/line-color/4258/1 "2005-05-25T19:55:49Z")

</div>

Hi all,

I can’t set the (foreground) color property of a vertical / horizontal line.  
They just stay black even when I use a method.  
No problems with the free line.  
Is this a bug?

XP / 2.2.rc7

---

<div class="post-metadata">

**Author:** ![bcusick](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@bcusick](https://forum.servoy.com/u/bcusick)\
**Post date:** [May 27, 2005, 12:15am UTC](https://forum.servoy.com/t/line-color/4258/2 "2005-05-27T00:15:33Z")

</div>

Ron,

You can’t set line properties programatically.

Also a horizontal line (if you chose it from the draw menu) is really a rectangle with a “SpecialMatte” applied to it (top line width = 1, top line color = black). You can edit it by clicking on it, and then modifying the “border” property.

---

<div class="post-metadata">

**Author:** ![david](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@david](https://forum.servoy.com/u/david)\
**Post date:** [May 27, 2005, 11:55am UTC](https://forum.servoy.com/t/line-color/4258/3 "2005-05-27T11:55:18Z")

</div>

You can use a label object with a bunch of underscore characters if you want programmatic control. Set to a specific font – don’t leave on default.

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [May 27, 2005, 12:22pm UTC](https://forum.servoy.com/t/line-color/4258/4 "2005-05-27T12:22:34Z")

</div>

I always use a label and just set its border properties using a style (no underscores necessary). Just create a style class like

```auto
label.some_label
{
	border-style: solid;
	border-width: 1px 0px 0px 0px;
}

```

and apply that to an empty label. With the example you get a 1px horizontal line. I wouldn’t use rectangles or anything like that. Maybe they disappear one day, since all they actually are is labels…

---

<div class="post-metadata">

**Author:** ![david](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@david](https://forum.servoy.com/u/david)\
**Post date:** [May 27, 2005, 12:47pm UTC](https://forum.servoy.com/t/line-color/4258/5 "2005-05-27T12:47:16Z")

</div>

The same drawback applies to styles that the “line” object has: you can’t change the line color programmatically. Which leaves you with only the fgcolor property of labels to work with (which changes the color of the text in a label).
