Click here to Skip to main content
15,905,614 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am in really truble.....
i want to create a windows form application in vb.net 2008..
i want to create a circle shape window....
how can i do it???
Any one can Help me???
Some type of idea can any one give me......
Posted

you can easily create it by using given code at Form_load event or in Form_Paint event
VB
Me.FormBorderStyle = FormBorderStyle.None
Dim graphicsPath As System.Drawing.Drawing2D.GraphicsPath = New System.Drawing.Drawing2D.GraphicsPath
graphicsPath.AddEllipse(Me.ClientRectangle)
Dim region As Region = New Region(graphicsPath)
Me.Region = region
 
Share this answer
 
v2
The simple example would be
C#
private void Form2_Paint(object sender, PaintEventArgs e)
 {
     GraphicsPath path = new GraphicsPath();
     path.AddEllipse(150f, 150f, 300f, 300f);
     e.Graphics.FillPath(Brushes.AliceBlue, path);
     Region rgn = new Region(path);
     e.Graphics.Clip = rgn;
     this.Region = rgn;
     path.Dispose();
     rgn.Dispose();
 }


This is not draggable. You need to implement that functionality. Same way close, minimize buttons has to be add.
 
Share this answer
 
Comments
Albin Abel 20-Mar-11 10:31am    
More on net http://www.vcskicks.com/custom_shape_form_region.php
http://www.codeproject.com/KB/cs/customforms.aspx
About 55,700 results (0.30 seconds)
Buy why? Windows came about to give a standard appearance (and to a certain extent, a standard feature set) to applications. When you start monkeying around with stuff, users get frustrated, and then angry.

However, if you insist of pursuing this, here are the general steps, and I leave it to your superior googling skills to find out how to do perform each step:

0) Create an image in your favorite graphics program that is the shape/color you desire.

1) Set the new image as the background of your form.

2) Hide the form's various titlebar buttons, and change the border to None.

3) Create/position/wire-up your own graphical buttons to replace the ones that would normally be seen in the titlebar.

4) Populate your for with the desired controls.

You may have to do other things, but once again, I think this is a BAD idea. How are you going to treat/redesign scroll bars? How about the shapes of other controls? Are you going to leave them with perfectly square corners? How about using colors the user sets in his Windows theme settings? You're going to pretty much have to ignore those.

See? Bad idea...
 
Share this answer
 

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