Lazarus

Using the Lazarus IDE => Editor => Topic started by: coolijo on August 21, 2004, 03:58:10 pm

Title: How to change color for only one character?
Post by: coolijo on August 21, 2004, 03:58:10 pm
Hi!

I have one problem. I'm doing a calendar. For showing days of the selected month I chose table. Problem appeared when I wanted to change color of the dates that are showing sundays or holidays.

I tried font.color but this didn't work because all the text went from default color to color I chose and not just one character.

I'm hoping that someone knows how to change color just for one character.

Bye
Title: How to change color for only one character?
Post by: Marc on August 24, 2004, 11:14:03 am
You need OwnerDraw for this (but I don't know if it is suppoerted yet)
Title: How to change color for only one character?
Post by: Lightning on August 25, 2004, 03:08:13 pm
Start your own component and draw that character in your favourite color as well as the grid (or whatever).
Use the canvas Font, Pen, Brush properties and draw Text and Lines.
It should be a little work but look at other custom components source code.
Delphi's DBGrids (i don't know about String or Draw Grid) support changing the column color so you could change the color for sundays, i didn't test this in Lazarus yet.
TinyPortal © 2005-2018