How I can change the color of a TPanel with the VCL Styles enabled?

前端 未结 3 1744
梦毁少年i
梦毁少年i 2020-12-15 09:37

I need to change the color of a TPanel when the VCL styles are enabled. I tried using and modifying the code listed in the article Changing the color of Edit Controls wi

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-15 09:40

    Based on @costa's answer, use:

    StyleElements := StyleElements - [seClient];
    

    in the constructor of your TPanel descendent class

    or if you just have some TPanel (or descendent class) instance you can do:

    with myPanel do StyleElements := StyleElements - [seClient];
    

    The -[...] syntax is used since the StyleElements is a set

    For more on StyleElements read this article:

    Tuning VCL Styles for Forms and Controls - http://edn.embarcadero.com/article/42812

提交回复
热议问题