Delphi 如何更改firemonkey中TTabcontrol的Ttabitem的背景色?

Delphi 如何更改firemonkey中TTabcontrol的Ttabitem的背景色?,delphi,firemonkey,Delphi,Firemonkey,如何更改firemonkey中TTabcontrol的Ttabitem的背景色?您可以修改TabItem的样式簿,并添加如下颜色层(例如tabcolor矩形): object TStyleContainer object TLayout StyleName = 'tabitemstylecolor' Position.X = 546.000000000000000000 Position.Y = 397.000000000000000000 Size.Widt

如何更改firemonkey中TTabcontrol的Ttabitem的背景色?

您可以修改TabItem的样式簿,并添加如下颜色层(例如tabcolor矩形):

object TStyleContainer
  object TLayout
    StyleName = 'tabitemstylecolor'
    Position.X = 546.000000000000000000
    Position.Y = 397.000000000000000000
    Size.Width = 67.000000000000000000
    Size.Height = 26.000000000000000000
    Size.PlatformDefault = False
    TabOrder = 0
    object TTabStyleObject
      StyleName = 'top'
      Align = Contents
      ClipChildren = True
      Locked = True
      SourceLookup = 'Windows 10 Desktopstyle.png'
      Size.Width = 67.000000000000000000
      Size.Height = 26.000000000000000000
      Size.PlatformDefault = False
      ActiveTrigger = Selected
      ActiveLink = <
        item
          CapInsets.Left = 4.000000000000000000
          CapInsets.Top = 4.000000000000000000
          CapInsets.Right = 4.000000000000000000
          CapInsets.Bottom = 4.000000000000000000
          SourceRect.Left = 55.000000000000000000
          SourceRect.Top = 90.000000000000000000
          SourceRect.Right = 97.000000000000000000
          SourceRect.Bottom = 114.000000000000000000
        end>
      SourceLink = <
        item
          CapInsets.Left = 4.000000000000000000
          CapInsets.Top = 4.000000000000000000
          CapInsets.Right = 4.000000000000000000
          CapInsets.Bottom = 4.000000000000000000
          SourceRect.Left = 5.000000000000000000
          SourceRect.Top = 90.000000000000000000
          SourceRect.Right = 47.000000000000000000
          SourceRect.Bottom = 113.000000000000000000
        end>
      HotLink = <
        item
          CapInsets.Left = 4.000000000000000000
          CapInsets.Top = 4.000000000000000000
          CapInsets.Right = 4.000000000000000000
          CapInsets.Bottom = 4.000000000000000000
          SourceRect.Left = 105.000000000000000000
          SourceRect.Top = 90.000000000000000000
          SourceRect.Right = 147.000000000000000000
          SourceRect.Bottom = 113.000000000000000000
        end>
      ActiveHotLink = <
        item
          CapInsets.Left = 4.000000000000000000
          CapInsets.Top = 4.000000000000000000
          CapInsets.Right = 4.000000000000000000
          CapInsets.Bottom = 4.000000000000000000
          SourceRect.Left = 55.000000000000000000
          SourceRect.Top = 90.000000000000000000
          SourceRect.Right = 97.000000000000000000
          SourceRect.Bottom = 114.000000000000000000
        end>
      FocusedLink = <
        item
          CapInsets.Left = 4.000000000000000000
          CapInsets.Top = 4.000000000000000000
          CapInsets.Right = 4.000000000000000000
          CapInsets.Bottom = 4.000000000000000000
          SourceRect.Left = 5.000000000000000000
          SourceRect.Top = 90.000000000000000000
          SourceRect.Right = 47.000000000000000000
          SourceRect.Bottom = 113.000000000000000000
        end>
      ActiveFocusedLink = <
        item
          CapInsets.Left = 4.000000000000000000
          CapInsets.Top = 4.000000000000000000
          CapInsets.Right = 4.000000000000000000
          CapInsets.Bottom = 4.000000000000000000
          SourceRect.Left = 105.000000000000000000
          SourceRect.Top = 118.000000000000000000
          SourceRect.Right = 147.000000000000000000
          SourceRect.Bottom = 142.000000000000000000
        end>
      object TRectAnimation
        Duration = 0.000009999999747379
        PropertyName = 'Margins'
        StartValue.Left = -1.000000000000000000
        StartValue.Top = 2.000000000000000000
        StartValue.Right = -1.000000000000000000
        StopValue.Left = -1.000000000000000000
        StopValue.Right = -1.000000000000000000
        StopValue.Bottom = -2.000000000000000000
        Trigger = 'IsSelected=True'
        TriggerInverse = 'IsSelected=false'
      end
      object TGlyph
        StyleName = 'glyphstyle'
        Margins.Left = 4.000000000000000000
        Margins.Right = -4.000000000000000000
        Align = Left
        Size.Width = 16.000000000000000000
        Size.Height = 16.000000000000000000
        Size.PlatformDefault = False
      end
      object TColorAnimation
        StyleName = 'coloranimation1'
        Duration = 0.200000002980232200
        StartValue = xFF29F029
        StopValue = xFFEA1818
        Trigger = 'IsSelected=true'
        TriggerInverse = 'IsSelected=false'
      end
      object TRectangle
        StyleName = 'tabcolor'
        Align = Client
        Fill.Color = xFFE76565
        HitTest = False
        Size.Width = 67.000000000000000000
        Size.Height = 26.000000000000000000
        Size.PlatformDefault = False
      end
      object TTabStyleTextObject
        StyleName = 'text'
        Align = Client
        Locked = True
        Margins.Left = 8.000000000000000000
        Margins.Top = 4.000000000000000000
        Margins.Right = 8.000000000000000000
        Margins.Bottom = 4.000000000000000000
        Size.Width = 51.000000000000000000
        Size.Height = 18.000000000000000000
        Size.PlatformDefault = False
        TextSettings.WordWrap = False
        ShadowVisible = False
        ActiveTrigger = Selected
        ActiveColor = claBlack
        HotColor = claBlack
      end
    end
    object TLayout
      StyleName = 'bottom'
      Align = Contents
      ClipChildren = True
      Locked = True
      Size.Width = 67.000000000000000000
      Size.Height = 26.000000000000000000
      Size.PlatformDefault = False
      object TRectAnimation
        Duration = 0.000009999999747379
        PropertyName = 'Margins'
        StartValue.Left = -1.000000000000000000
        StartValue.Right = -1.000000000000000000
        StartValue.Bottom = 2.000000000000000000
        StopValue.Left = -1.000000000000000000
        StopValue.Top = -2.000000000000000000
        StopValue.Right = -1.000000000000000000
        Trigger = 'IsSelected=True'
        TriggerInverse = 'IsSelected=false'
      end
      object TTabStyleObject
        Align = Contents
        Locked = True
        SourceLookup = 'Windows 10 Desktopstyle.png'
        RotationAngle = 180.000000000000000000
        Size.Width = 67.000000000000000000
        Size.Height = 26.000000000000000000
        Size.PlatformDefault = False
        ActiveTrigger = Selected
        ActiveLink = <
          item
            CapInsets.Left = 4.000000000000000000
            CapInsets.Top = 4.000000000000000000
            CapInsets.Right = 4.000000000000000000
            CapInsets.Bottom = 4.000000000000000000
            SourceRect.Left = 55.000000000000000000
            SourceRect.Top = 90.000000000000000000
            SourceRect.Right = 97.000000000000000000
            SourceRect.Bottom = 114.000000000000000000
          end>
        SourceLink = <
          item
            CapInsets.Left = 4.000000000000000000
            CapInsets.Top = 4.000000000000000000
            CapInsets.Right = 4.000000000000000000
            CapInsets.Bottom = 4.000000000000000000
            SourceRect.Left = 5.000000000000000000
            SourceRect.Top = 90.000000000000000000
            SourceRect.Right = 47.000000000000000000
            SourceRect.Bottom = 113.000000000000000000
          end>
        HotLink = <
          item
            CapInsets.Left = 4.000000000000000000
            CapInsets.Top = 4.000000000000000000
            CapInsets.Right = 4.000000000000000000
            CapInsets.Bottom = 4.000000000000000000
            SourceRect.Left = 105.000000000000000000
            SourceRect.Top = 90.000000000000000000
            SourceRect.Right = 147.000000000000000000
            SourceRect.Bottom = 113.000000000000000000
          end>
        ActiveHotLink = <
          item
            CapInsets.Left = 4.000000000000000000
            CapInsets.Top = 4.000000000000000000
            CapInsets.Right = 4.000000000000000000
            CapInsets.Bottom = 4.000000000000000000
            SourceRect.Left = 55.000000000000000000
            SourceRect.Top = 90.000000000000000000
            SourceRect.Right = 97.000000000000000000
            SourceRect.Bottom = 114.000000000000000000
          end>
        FocusedLink = <
          item
            CapInsets.Left = 4.000000000000000000
            CapInsets.Top = 4.000000000000000000
            CapInsets.Right = 4.000000000000000000
            CapInsets.Bottom = 4.000000000000000000
            SourceRect.Left = 5.000000000000000000
            SourceRect.Top = 90.000000000000000000
            SourceRect.Right = 47.000000000000000000
            SourceRect.Bottom = 113.000000000000000000
          end>
        ActiveFocusedLink = <
          item
            CapInsets.Left = 4.000000000000000000
            CapInsets.Top = 4.000000000000000000
            CapInsets.Right = 4.000000000000000000
            CapInsets.Bottom = 4.000000000000000000
            SourceRect.Left = 105.000000000000000000
            SourceRect.Top = 118.000000000000000000
            SourceRect.Right = 147.000000000000000000
            SourceRect.Bottom = 142.000000000000000000
          end>
      end
      object TGlyph
        StyleName = 'glyphstyle'
        Margins.Left = 4.000000000000000000
        Margins.Right = -4.000000000000000000
        Align = Left
        Size.Width = 16.000000000000000000
        Size.Height = 16.000000000000000000
        Size.PlatformDefault = False
      end
      object TTabStyleTextObject
        StyleName = 'text'
        Align = Client
        Locked = True
        Margins.Left = 8.000000000000000000
        Margins.Top = 4.000000000000000000
        Margins.Right = 8.000000000000000000
        Margins.Bottom = 4.000000000000000000
        Size.Width = 51.000000000000000000
        Size.Height = 18.000000000000000000
        Size.PlatformDefault = False
        TextSettings.WordWrap = False
        ShadowVisible = False
        ActiveTrigger = Selected
        ActiveColor = claBlack
        HotColor = claBlack
      end
    end
  end
end
对象容器
对象TLayout
StyleName='tabitemstylecolor'
位置X=546.000000000000000000000000000000
位置Y=397.000000000000000000000000
大小.宽度=67.000000000000000000000000
大小.高度=26.000000000000000000000000000000
Size.PlatformDefault=False
TabOrder=0
对象TTabStyleObject
StyleName='top'
对齐=内容
ClipChildren=True
锁定=真
SourceLookup='Windows 10 Desktopstyle.png'
大小.宽度=67.000000000000000000000000
大小.高度=26.000000000000000000000000000000
Size.PlatformDefault=False
ActiveTrigger=已选择
动态链接=<
项目
CapInsets.Left=4.000000000000000000000000
CapInsets.Top=4.000000000000000000000000
CapInsets.Right=4.000000000000000000000000
CapInsets.Bottom=4.000000000000000000000000
SourceRect.Left=55.000000000000000000000000
SourceRect.Top=90.000000000000000000
SourceRect.Right=97.000000000000000000000000
SourceRect.Bottom=114.000000000000000000
结束>
SourceLink=<
项目
CapInsets.Left=4.000000000000000000000000
CapInsets.Top=4.000000000000000000000000
CapInsets.Right=4.000000000000000000000000
CapInsets.Bottom=4.000000000000000000000000
SourceRect.Left=5.000000000000000000000000
SourceRect.Top=90.000000000000000000
SourceRect.Right=47.000000000000000000
SourceRect.Bottom=113.000000000000000000
结束>
热链接=<
项目
CapInsets.Left=4.000000000000000000000000
CapInsets.Top=4.000000000000000000000000
CapInsets.Right=4.000000000000000000000000
CapInsets.Bottom=4.000000000000000000000000
SourceRect.Left=105.000000000000000000000000
SourceRect.Top=90.000000000000000000
SourceRect.Right=147.000000000000000000000000
SourceRect.Bottom=113.000000000000000000
结束>
动态热链接=<
项目
CapInsets.Left=4.000000000000000000000000
CapInsets.Top=4.000000000000000000000000
CapInsets.Right=4.000000000000000000000000
CapInsets.Bottom=4.000000000000000000000000
SourceRect.Left=55.000000000000000000000000
SourceRect.Top=90.000000000000000000
SourceRect.Right=97.000000000000000000000000
SourceRect.Bottom=114.000000000000000000
结束>
焦点链接=<
项目
CapInsets.Left=4.000000000000000000000000
CapInsets.Top=4.000000000000000000000000
CapInsets.Right=4.000000000000000000000000
CapInsets.Bottom=4.000000000000000000000000
SourceRect.Left=5.000000000000000000000000
SourceRect.Top=90.000000000000000000
SourceRect.Right=47.000000000000000000
SourceRect.Bottom=113.000000000000000000
结束>
ActiveFocusedLink=<
项目
CapInsets.Left=4.000000000000000000000000
CapInsets.Top=4.000000000000000000000000
CapInsets.Right=4.000000000000000000000000
CapInsets.Bottom=4.000000000000000000000000
SourceRect.Left=105.000000000000000000000000
SourceRect.Top=118.000000000000000000000000
SourceRect.Right=147.000000000000000000000000
SourceRect.Bottom=142.000000000000000000
结束>
物体立体化
持续时间=0.0000099999747379
PropertyName='页边距'
StartValue.Left=-1.000000000000000000000000
StartValue.Top=2.000000000000000000000000
StartValue.Right=-1.000000000000000000000000
StopValue.Left=-1.000000000000000000
StopValue.Right=-1.000000000000000000
StopValue.Bottom=-2.000000000000000000
触发器='IsSelected=True'
TriggerInverse='IsSelected=false'
结束
对象TGlyph
StyleName='glyphstyle'
页边距。左=4.000000000000000000000000
右边=-4.000000000000000000000000
左对齐
大小.宽度=16.000000000000000000000000
大小.高度=16.000000000000000000000000000000
Size.PlatformDefault=False
结束
物体颜色
StyleName='coloranimation1'
持续时间=0.20000000298023200
起始值=xFF29F029
StopValue=xFFEA1818
触发器='IsSelected=true'
TriggerInverse='IsSelected=false'
结束
对象树角
StyleName='tabcolor'
Align=客户端
Fill.Color=xFFE76565
HitTest=错误
大小.宽度=67.000000000000000000000000
大小.高度=26.000000000000000000000000000000
Size.PlatformDefault=False
结束
对象TTabStyleTextObject
StyleName='text'
Align=客户端
锁定=真
页边距。左=8.000000000000000000000000
页边距。顶部=4.000000000000000000000000
页边距。右侧=8.000000000000000000000000
页边距。底部=4.000000000000000000000000
大小.宽度=51.000000000000000000000000
大小.高度=18.000000000000000000000000000000
Size.PlatformDefault=False
TextSettings.WordWrap=False
ShadowVisible=False
ActiveTrigger=已选择
ActiveColor=claBlack
HotColor=黑色
结束
结束
对象TLayout
StyleName='bottom'
对齐=内容
ClipChildren=True
锁定=真
大小.宽度=67.000000000000000000000000
大小.高度=26.000000000000000000000000000000
Size.PlatformDefault=False
物体立体化
持续时间=0.0000099999747379
PropertyName='页边距'
StartValue.Left=-1.000000000000000000000000
StartValue.Right=-1.000000000000000000000000
StartValue.Bottom=2.000000000000000000000000
StopValue.Left=-1.000000000000000000
停止值。顶部