🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.vcl.components.using.general
2 messages
2 total messages Started by Liatifis Kostas Fri, 04 Jul 2008 19:45
Headercontrol color
#135
Author: Liatifis Kostas
Date: Fri, 04 Jul 2008 19:45
7 lines
1024 bytes
Dear Sir

i have a headercontrol with some sections now i want one of them to changr 
the color
How can i do?
Please write the code
Thank you for your time
Re: Headercontrol color
#136
Author: Peter Below (TeamB)
Date: Sat, 05 Jul 2008 07:57
32 lines
1746 bytes
Liatifis Kostas wrote:

> Dear Sir
> 
> i have a headercontrol with some sections now i want one of them to
> changr the color How can i do?
> Please write the code
> Thank you for your time

You have to draw the section yourself. Set the header sections  Style
property to hsOwnerDrawn and handle the headercontrols OnDrawSection
event.

procedure TMainform.HeaderControl1DrawSection(HeaderControl:
  THeaderControl; Section: THeaderSection; const Rect: TRect; Pressed:
  Boolean);
var
  CV: TCanvas;
begin
  CV:= Headercontrol.Canvas;
  if Pressed then
    CV.Brush.Color := clYellow;
  CV.FillRect(Rect);
  CV.TextRect(Rect, Rect.Left+2, Rect.Top, Section.Text);  
end;

-- 
Peter Below (TeamB)  
Don't be a vampire (http://slash7.com/pages/vampires), 
use the newsgroup archives :
http://www.tamaracka.com/search.htm
http://groups.google.com
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads