Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
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 21:38pm
Rate this: bad
good
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
 
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!
Smile | :)
  Permalink  
v2
Rate this: bad
good
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);;
            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.
  Permalink  
Comments
snehasish nandy at 6-Dec-12 6:21am
   
where i have to put this piece of code..
OriginalGriff at 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)



Advertise | Privacy | Mobile
Web01 | 2.8.141223.1 | Last Updated 6 Dec 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