Getting colour of skinned TPanel

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #33794
    ael
    Participant

    Hello,

    I have the following structure in a form : TPanel containing a TsScrollBox containing a TPaintbox.

    I'd like to specify as the background colour for the TPaintbox the skinned colour of the parent TPanel, however after a few tries and searches through this forum I can't seems to find anything useful.

    – How can get the colour of a skinned component ?

    – Would it be possible or better if I used a TsPanel instead of a TPanel as a parent of the TPaintbox ?

    #42749
    Support
    Keymaster

    Hello

    You can try this code

    CODE
    Color := TColor(SendMessage(Panel.Handle, SM_ALPHACMD, MakeWParam(0, AC_GETCONTROLCOLOR), 0))


    (!) uses sMessages;

    But using TsPanel is always more preferably, this control especially optimized for work with AlphaSkins.
    For the TsPanel may be used this function : Color := GetBGColor(sPanel1.SkinData, 0); (uses sCommonData)

    #42778
    ael
    Participant

    Hello,

    QUOTE
    You can try this code

    It works perfectly, thanks a lot !

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