With Windows Presentation Foundation (WPF), it’s easy to craft irregular, non-rectangular top-level windows without borders to create a unique splash screen or a gadget-style user interface:
- Modify the Window Properties
- Set AllowTransparency property to true.
- Set WindowStyle to None to remove window chrome
- Set Background to Transparent
- Add support for moving and closing the window if needed
- Use the Window’s DragMove() method to allow users to reposition the Window
- Add a UI element to allow users to close the window
void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { // DragMove handles all the window placement automatically! this.DragMove(); }
2 responses so far ↓
Cindy // September 21, 2008 at 7:10 pm |
Thank you so much for this! It solved the problem I was having with no being able to move the transparent window by clicking and dragging the image. Thanks again!
Ashish Sehajpal // January 16, 2009 at 7:24 am |
It made my clock superb!
thanks buddy..