Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c# non rectangular window, library?

Tags:

c#

wpf

I know its possible to make a non rectangular window in c#. but i know many programs like windows mediaplayer and other software who got a beautiful layout at the corners etc. but when i draw a circle or something as a non rect. window the system doesnt know what to do with the pixels :S. is there a good way to make beautiful windows for c#, or a library or something?

thnx!

like image 957
stefan Avatar asked Mar 12 '26 14:03

stefan


1 Answers

From the WPF Windows Overview:

"Non-Rectangular Window Style

There are also situations where the border styles that WindowStyle allows you to have are not sufficient. For example, you may want to create an application with a non-rectangular border, like Microsoft Windows Media Player uses.

For example, consider the speech bubble window shown in the following figure. alt text

This type of window can be created by setting the WindowStyle property to None, and by using special support that Window has for transparency.

<Window 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    WindowStyle="None"
    AllowsTransparency="True"
    Background="Transparent">
...

</Window>

This combination of values instructs the window to render completely transparent. In this state, the window's non-client area adornments (the Close menu, Minimize, Maximize, and Restore buttons, and so on) cannot be used. Consequently, you need to provide your own."

And an article on doing the same in winforms.

like image 121
marr75 Avatar answered Mar 14 '26 03:03

marr75



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!