Click here to Skip to main content
12,999,744 members (42,789 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi all

I want to make my login screen in different shape.means usually the forms are of rectangle shape but i want to change that shape..

Please give me some suggestion..

Thank you
Posted 5-Dec-12 20:38pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

follow steps,

just create desired shape in paint and fill with color,
leave the portion white you not want to show
save image


in winform set it as background image
and set TransparencyKey property = white
ControlBox = False
FormBorderStyle = None

run ...

note: this way can use images and set transparency color

Happy Coding!
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Provided you don't need the title bar, or the system buttons, you can make any form (or any control) any shape you like by setting it's Region property:
GraphicsPath path = new GraphicsPath();
Rectangle rect = Rectangle(0, 0, 200, 200);;
Region = new Region(path);
This sets the form to a small circle.
If you do this, you will be responsible for making sure that your controls are visible, you will need to do border effects yourself,and ensure there is some way for the user to close / minimize it.
snehasish nandy 6-Dec-12 6:21am
where i have to put this piece of code..
OriginalGriff 6-Dec-12 6:37am
Constructor? Form Load event? Shown event? Up to you really! :laugh:

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170624.1 | Last Updated 6 Dec 2012
Copyright © CodeProject, 1999-2017
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