Some one asked me "How to make a login form which must have elliptical shape in windows application using C# (.Net)". I replied him to make the background of form transparent and put an image of ellipse as a background image of the form. However, the person was not satisfied. I think that he was expecting more logical answer.
Asked
Active
Viewed 413 times
-2
-
Off-Topic (+1 to David's link) but this seems like an outdated style and might be worth talking to them about modernization – Sayse Apr 01 '14 at 18:31
-
Most logical answer will be: "Oh sure, you can make it several times slower by forcing custom made regions from winapi calls instead of neat rectangle which is very simple for computation. Here, take lagging form, maybe you want it written in script language emulated in Java to perform finishing move on cpu?" – PTwr Apr 01 '14 at 18:32
-
`more logical answer`: Use WPF. winforms is a really old technology no one cares about anymore, and which does not support anything. `even more logical answer:` Microsoft reduced (almost eliminated) the amount of transparencies and non-square regions in Windows 8 for performance reasons. You should consider whether you really want to degrade performance with this technique. – Federico Berasategui Apr 01 '14 at 18:33
-
@HighCore: I'm curious, do you have numbers on how many applications have been and are being written in WF and WPF? – TaW Apr 01 '14 at 19:38
-
@TaW why would I care about that? do you have numbers of how many applications have been written in COBOL? that doesn't make COBOL less useless and deprecated in the present world in 2014. Please... – Federico Berasategui Apr 01 '14 at 19:39
-
@HighCore, I don't care what you care about and neither what you know. I was curious and thought you had facts not just opionions. Wrt COBOL, you'd be amazed.. (Also appalled ;-) – TaW Apr 01 '14 at 19:44
-
@TaW Fact: winforms doesn't support anything, it requires a ridiculous amount of code to do anything and doesn't allow any kind of customization without resorting to a bunch of horrible hacks. WPF is a modern UI framework capable of advanced DataBinding and highly customizable, with built-in hardware acceleration, vector graphics and support for rich interactivity features such as Animations and Transitions. It allows a huge level of decoupling between the UI and the application logic and data, thus enabling greater scalability, maintainability and even portability. – Federico Berasategui Apr 01 '14 at 19:46
-
@TaW Fact #2: [Microsoft is working on the next version of WPF](https://careers.microsoft.com/jobdetails.aspx?jid=137020&pp=VR) and they call it *"the premier application development framework for Windows desktop applications"*, while winforms did not recieve a relevant improvement in 6+ years. – Federico Berasategui Apr 01 '14 at 19:54
-
@HighCore: Take it easy, man. Maybe Winforms is stable and mature? And since you can show a perfectly elliptical login window in three lines it can't be all bad. Just kidding you ;-) – TaW Apr 01 '14 at 19:58
-
@TaW Fact #3: XAML + MVVM can be reused throughout a variety of XAML-based technologies (Silverlight, though it's dead, Windows Phone and WinRT "Store" apps). Horrible winforms hacks are completely useless outside the winforms world. – Federico Berasategui Apr 01 '14 at 19:59
-
@TaW `Maybe Winforms is stable and mature` - COBOL is also "stable and mature"... – Federico Berasategui Apr 01 '14 at 20:00
-
@HighCore: COBOL is also "stable and mature"... Indeed. And it probably moves every single monetary tranaction your money has ever seen. – TaW Apr 01 '14 at 20:01
-
@TaW that doesn't make it less useless in the present world in 2014. Would you choose COBOL as the technology to start a new Windows Application? Your argument is pointless, and we shouldn't be arguing here in SO, create a chatroom if you want to continue the discussion. – Federico Berasategui Apr 01 '14 at 20:02
-
@highCore. We shouldn't be arguing here in SO. Agreed. In fact we simply shouldn't argue at all. Bye. – TaW Apr 01 '14 at 20:03
1 Answers
0
Yes, this will look terrible..
InitializeComponent();
using (GraphicsPath GP = new GraphicsPath() )
{
GP.AddEllipse(this.ClientRectangle);
this.Region = new Region(GP);
}
You shouldn't. Seriously.
But if you do, make sure this is also made moveable..

TaW
- 53,122
- 8
- 69
- 111