Click here to Skip to main content
Sign Up to vote bad
good
See more: WPFC#4.0
Hello everybody...
i want to make login screen in wpf. it will circle form. is it possible ?
Posted 16 Nov '12 - 10:32

Comments
Sergey Alexandrovich Kryukov - 16 Nov '12 - 16:44
What is a "form in WPF"? WPF does not have forms, if I'm not much mistaken. Do you mean a window with true round shape? This is not a problem at all... --SA

2 solutions

This might be what you are looking for: Shaped WPF Form[^]
  Permalink  
Comments
Sergey Alexandrovich Kryukov - 16 Nov '12 - 16:57
Good link, a 5. I also answered, suggesting two different ways, and explained some important detail -- please see. --SA
Sergey Alexandrovich Kryukov - 16 Nov '12 - 17:10
Actually, after a better look: this article suggests not the best solution -- the one based on transparency. Much better solution is based on VisualClip; again, please see my answer. --SA
Espen Harlinn - 17 Nov '12 - 8:56
5'ed!
Please see my comment to the question. Is that what you need?
 
If so, one of the way to do it is to assign some instance of System.Windows.Media.Geometry of non-rectangular shape to the property System.Windows.Window.VisualClip:
http://msdn.microsoft.com/en-us/library/system.windows.window.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.media.visual.visualclip.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.media.geometry.aspx[^].
 
This method is the cleanest one: not only a window looks non-rectangular visually (like it would look with transparency), but is also transparent to mouse events, for example: you click mouse in the corner; and the window of the application beneath is activated — this is something you really need.
 
It's also good to use WindowStyle="None"; to avoid showing non-client areas of the window.
 
Another way is related to Background, AllowsTransparency, and WindowStyle properties:
http://msdn.microsoft.com/en-us/library/ms748948.aspx[^] (read: "Non-Rectangular Window Style"),
http://msdn.microsoft.com/en-us/library/aa358516%28v=vs.85%29.aspx[^].
 
Good luck,
—SA
  Permalink  
Comments
Espen Harlinn - 17 Nov '12 - 8:57
5'ed!
Sergey Alexandrovich Kryukov - 17 Nov '12 - 21:18
Thank you, Espen. --SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 206
1 Sergey Alexandrovich Kryukov 175
2 Richard MacCutchan 145
3 Tadit Dash 140
4 Santhosh G_ 125
0 Sergey Alexandrovich Kryukov 10,294
1 OriginalGriff 7,955
2 CPallini 4,201
3 Rohan Leuva 3,522
4 Maciej Los 3,159


Advertise | Privacy | Mobile
Web03 | 2.6.130523.1 | Last Updated 16 Nov 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid