Question WPF Custom Window Border for Children

Basically you can just set some options for the BorderThickness and BorderBrush properties of the Window, eg select Image Brush, select the image, set to Tile. Thickness like image.
If you manage the size and set to a multiple of the image size it will tile nicer. Also if the image has transparancy you can set AllowTransparancy=True and WindowStyle=None, which will make the border tranparent around the flowers, looks quite nice when you see it in action! I'm attaching a sample project, the image was resampled from yours. Since this sample window has no title bar I added some code so it can be dragged around anyway.
wpf-flowerborder.png
 

Attachments

  • WpfAppSunflower.zip
    20.2 KB · Views: 27
Basically you can just set some options for the BorderThickness and BorderBrush properties of the Window, eg select Image Brush, select the image, set to Tile. Thickness like image.
If you manage the size and set to a multiple of the image size it will tile nicer. Also if the image has transparancy you can set AllowTransparancy=True and WindowStyle=None, which will make the border tranparent around the flowers, looks quite nice when you see it in action! I'm attaching a sample project, the image was resampled from yours. Since this sample window has no title bar I added some code so it can be dragged around anyway.
Hello!

Thanks so much for you answer! With your example how is it possible to make the window bigger cause I changed the window settings to 800 with and 600 height but the application stays small?

Thanks for the answer it was a great help!

Kind regards,
Vincent
 
Have a look in the window code, and also keep in mind the explanation ;)
 
Have a look in the window code, and also keep in mind the explanation ;)

Hello!

Thanks for that info everything is working fine:
applicationr.jpg



Now my question is if it's possible to fade the white border so the transition from the sunflowers to the white is cleaner.

Greetz!
-Vincent-
 
Back
Top