In previous versions of Microsoft .Net Framework, creating shaped windows was a time-consuming process that involved Win API calls.Not anymore – one of the modern aspects of WPF is that you can make non-rectangular windows in simple way.Creating shaped forms works in the following manner.First, you create an image, which, when we are finished, will act as your window. Second, you change a XAML to make this image become the form.
- Create a transparent image file that will be used to set the desired shape of the window.
- Create a Windows Application(WPF) project and add the image control to it.Remember to make the window transparent as shown in code below
Title="WindowsApplication1" Height="300" Width="300"
<Image Name="image1" />
- Add code that recreates the functionality that the title bar provided, such as moving the window and closing it.
/// Interaction logic for Window1.xaml
public partial class Window1 : System.Windows.Window
image1.Source = new BitmapImage(
new Uri(@"C:\Documents and Settings\username\Desktop\Untitled.png"));
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
protected override void OnMouseRightButtonDown(MouseButtonEventArgs e)