![]() |
![]() |
|
|||||||
| Register | Forum Rules | Getting Started! - Guide | Blog | Videos | Gallery | Members List | Social Groups | Mark Forums Read |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 |
|
Webmaster
![]() Join Date: Nov 2005
Location: The Last City!
Posts: 4,164
Thanks: 430
Thanked 462 Times in 403 Posts
Rep Power: 2739
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() OS:
|
[.NET] Non Rectangular Forms
Have you ever wondered how you can create nonrectangular forms? Windows Media Player is a good example. When you switch to different skins, the border changes shapes. It seems like quite a difficult task, but it ends up being extremely simple. It's really only a few lines of code! But these few lines of code can make a big difference in the visual impression your project creates.
First create a new Windows Forms project using C#. (This can be done in any .NET language, but we'll use C# for this example.) Add a button to the middle of the form. Add this code to the button: Code:
private void button1_Click(object sender, System.EventArgs e)
{
System.Drawing.Drawing2D.GraphicsPath p = new System.Drawing.Drawing2D.GraphicsPath();
int width = this.ClientSize.Width;
int height = this.ClientSize.Height;
p.AddClosedCurve(new Point[]{new Point(width/2, height/10),
new Point(width,0), new Point(width, height/3),
new Point(width-width/3, height),
new Point(width/7, height-height/} );
this.Region = new Region(p);
}
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Forms and fields | rexmann | Microsoft Office | 3 | 27-09-2007 04:29 PM |
| Forms | SuzieB | Microsoft Office | 1 | 04-09-2007 05:31 PM |
| Cannot fill out forms in IE7 | RR2 | Internet Explorer | 4 | 29-08-2007 07:26 AM |
| Cannot fill out forms in IE7 | RR2 | Internet Explorer | 0 | 29-08-2007 07:25 AM |
| Cannot fill out forms in IE7 | RR2 | Internet Explorer | 3 | 29-08-2007 07:24 AM |
< Home - Windows Help - MS Office Help - Hardware Support >
| New To Site? | Need Help? |