Re: Checkbox with colored background?
- From: "DAVID B MORGAN" <lepton2@xxxxxxxxxxx>
- Date: Tue, 22 Nov 2005 06:33:03 GMT
"Harvey Wilson" <firstname@xxxxxxxxxx> wrote in message
news:438209ab.694731390@xxxxxxxxxxxxxxxxxx
> Can anyone please point me to a freeware checkbox component that
> allows the background of the checkmark to change color? I have seen
> several that allow the color behind the text to be changed, but I want
> to be able to change the area in the actual box.
>
> Or, if you have some code I can add to one of the existing components
> to make a new one that would have this capability that would be great.
>
> Thanks
> Harvey
Harvey,
This is what I did for a quick and dirty solution. If you don't need all the
methods and events of Tcheckbox
this may be all you need.
1 Place a Tpanel on your form
2 Place a second Tpanel inside the first Tpanel
3 Change the color of panel2 to whatever you desire
4 Size panel2 to simulate the Tcheckbox
5 Change the panel2 bevel and border properties to simulate the Tcheckbox
6 Set the font of panel2 to Wingdings
7 Add the following procedures to your code
================================================
procedure TForm1.Panel2Click(Sender: TObject);
begin
Panel2dblClick(Sender);
end;
procedure TForm1.Panel2DblClick(Sender: TObject);
begin
if panel2.Caption='' then panel2.Caption:=chr($FC) else
panel2.Caption:='';
end;
====================================================
HTH
DBM
.
- References:
- Checkbox with colored background?
- From: Harvey Wilson
- Checkbox with colored background?
- Prev by Date: Re: Checkbox with colored background?
- Next by Date: Re: Checkbox with colored background?
- Previous by thread: Re: Checkbox with colored background?
- Next by thread: Re: Checkbox with colored background?
- Index(es):
Relevant Pages
|
|