* * *

Author Topic: TTogglebox color  (Read 323 times)

Switcher

  • New member
  • *
  • Posts: 5
TTogglebox color
« on: February 10, 2012, 11:00:39 pm »
Hello there

Is there a way to change the color of the TTogglebox depending  of its state, i would like to have a green box in the unselected mode an d a red one if checked (obvious)

In the example below the caption is changed in the correct way; the.Color instruction has no effect and the//....ParentColor line generates a "identifier idents no member'ParentColor'" although you'll find this property in the TTogglebox.dropdow list

Thanks

Code: [Select]
procedure TForm1.ToBoEvTaClick(Sender: TObject);
begin
   if ToBoEvTa.State=cbunchecked then
      begin
         ToBoEvTa.caption :='Run Event Table';
         //ToBoEvTa.ParentColor:=False;
         ToBoEvTa.Color:=clLime;
      end
   else
       begin
          //ToBoEvTa.ParentColor:=False;
          ToBoEvTa.Color:=clRed;
          ToBoEvTa.caption :='Stop Event Table';

       end

end;

zeljko

  • Sr. Member
  • ****
  • Posts: 289
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: TTogglebox color
« Reply #1 on: February 17, 2012, 10:44:01 am »
It depends on widgetset I guess. Under qt it's possible, don't know what ws you're talking about.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads