Recent

Author Topic: How to change color for only one character?  (Read 8114 times)

coolijo

  • Guest
How to change color for only one character?
« 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

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2584
How to change color for only one character?
« Reply #1 on: August 24, 2004, 11:14:03 am »
You need OwnerDraw for this (but I don't know if it is suppoerted yet)
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

Lightning

  • Sr. Member
  • ****
  • Posts: 422
How to change color for only one character?
« Reply #2 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.
The future must be... Fast and OpenSource so...
Think Open and Lightning Fast!

 

TinyPortal © 2005-2018