Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

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:
C#
GraphicsPath path = new GraphicsPath();
Rectangle rect = Rectangle(0, 0, 200, 200);;
path.AddEllipse(rect);
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.
 
Share this answer
 
Comments
[no name] 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:
follow steps,

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

now

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!
:)
 
Share this answer
 
v2

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