window-decoration

How to draw Windows Classic style window elements

狂风中的少年 提交于 2019-12-31 01:00:14
问题 We create a few custom 'windows' in our program and when VisualStyles are enabled we are able to find each element of the window and their size and paint them ourselves including the minimize and close buttons using the appropriate Renderers. We'd like to do that same thing when VisualStyles are disabled and currently draw our own windows but they're quite ugly. Is it possible in WinForms C# to draw the Windows Classic style windows? I've found the ClassicBorderDecorator but it's for WPF. Or,

Dynamically show and hide JFrame decorations

最后都变了- 提交于 2019-12-13 14:41:00
问题 I am developing a Java Swing-based application with different perspectives. For the "main menu" perspective I do not want the window (JFrame) to be decorated, while in other perspective I do want the window to be decorated. In other words, I need want to change the decoration attribute dynamically. I have tried to use setUndecorated(false) and setUndecorated(true) , but I seems I can only set this once, before actually showing the window. Is there a way to achieve this? 回答1: From the javadoc:

How to draw Windows Classic style window elements

纵饮孤独 提交于 2019-12-01 18:42:36
We create a few custom 'windows' in our program and when VisualStyles are enabled we are able to find each element of the window and their size and paint them ourselves including the minimize and close buttons using the appropriate Renderers. We'd like to do that same thing when VisualStyles are disabled and currently draw our own windows but they're quite ugly. Is it possible in WinForms C# to draw the Windows Classic style windows? I've found the ClassicBorderDecorator but it's for WPF. Or, failing that, how can we get the pixel sizes of the window decorations which we do in the following