Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: WPF C#4.0
Hello everybody...
i want to make login screen in wpf. it will circle form. is it possible ?
Posted 16-Nov-12 11:32am
Comments
Sergey Alexandrovich Kryukov at 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
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

This might be what you are looking for: Shaped WPF Form[^]
  Permalink  
Comments
Sergey Alexandrovich Kryukov at 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 at 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 at 17-Nov-12 8:56am
   
5'ed!
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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  
v2
Comments
Espen Harlinn at 17-Nov-12 8:57am
   
5'ed!
Sergey Alexandrovich Kryukov at 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)

  Print Answers RSS
0 Marcin Kozub 275
1 OriginalGriff 264
2 Sergey Alexandrovich Kryukov 215
3 Praneet Nadkar 197
4 Richard MacCutchan 182
0 OriginalGriff 8,048
1 Sergey Alexandrovich Kryukov 7,287
2 DamithSL 5,614
3 Manas Bhardwaj 4,986
4 Maciej Los 4,910


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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100