开发者

Why TPanel does not show correct frame/border in Delphi XE?

开发者 https://www.devze.com 2023-03-26 14:10 出处:网络
Tpanel does not show the top and left border under Delphi XE/Win 7. Why? Example (I just dropped few TPanel from pallete to my form, inside of a TTabSheet):

Tpanel does not show the top and left border under Delphi XE/Win 7. Why?

Example (I just dropped few TPanel from pallete to my form, inside of a TTabSheet):

Why TPanel does not show correct frame/border in Delphi XE?

How do I make it look开发者_运维技巧 like the original Delphi 7 control (with all 4 borders), without changeing its properties every time I place it on my form?


Set ParentBackground to false.

Why TPanel does not show correct frame/border in Delphi XE?

Above is a blue panel on a green form (ParentBackground = false). Notice the white upper-left border and the gray bottom-right border. Of course, if both the form and the panel are white, the white border will become invisible.


That is how it meant to be drawn. The 3D effect is as if there was a light source shining from the top left. That's why the bottom and right edges are in a shadow cast by the raised panel.


Regarding your updated question, it sounds like you want your application to run without themes. The easiest way is to uncheck "Enable runtime themes" in the Application pane of the project settings.

But of course that would look odd nowadays. If you are using the panel to group related controls, perhaps a group box would be better. My instincts are that panels with raised borders will look poor on modern themed Windows.

0

精彩评论

暂无评论...
验证码 换一张
取 消