Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everybody...
i want to make login screen in wpf. it will circle form. is it possible ?
Posted
Comments
Sergey Alexandrovich Kryukov 16-Nov-12 16:44pm    
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

This might be what you are looking for: Shaped WPF Form[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 16-Nov-12 16:57pm    
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:10pm    
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:56am    
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
 
Share this answer
 
v2
Comments
Espen Harlinn 17-Nov-12 8:57am    
5'ed!
Sergey Alexandrovich Kryukov 17-Nov-12 21:18pm    
Thank you, Espen.
--SA

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900