Selection color in TsListview

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #36794
    Outertech
    Participant

    The selection mark color of a TsListview item is set by AlphaSkins when changing the skin.

    Is there any way to change the color at runtime? (of both focused and unfocused selection).

    In particular I need to make the focused and unfocused selection color to be the same.

    Any method will be sufficient (changing a property, changing the source code, editing a skin).

    #54512
    Support
    Keymaster

    Hello!

    You should override the 'SELECTION' skin section in run-time using similar code:

    Code:
    if sSkinManager1.ConstData.Sections[ssSelection] >= 0 then begin
    sSkinManager1.gd[sSkinManager1.ConstData.Sections[ssSelection]].Props[0].Color := YourColor;
    sSkinManager1.gd[sSkinManager1.ConstData.Sections[ssSelection]].Props[0].GradientPercent := 0;
    sSkinManager1.gd[sSkinManager1.ConstData.Sections[ssSelection]].Props[1].Color := YourColor;
    sSkinManager1.gd[sSkinManager1.ConstData.Sections[ssSelection]].Props[1].GradientPercent := 0;
    end;

    Also, you can change palette of the skin additionaly for cases when 'SELECTION' not used:

    Code:
    sSkinManager1.Palette[pcSelectionBG] := YourColor;
    sSkinManager1.Palette[pcSelectionBG_Focused] := YourColor;

    Write me if this information is not enough.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.