Hello, I want to create a special form with special design, just like the visual studio 2010 opening form.
I have created an ellipse form, but I want a special form wikthout edges. Here some code for the ellipse form:
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
namespace NonrectangularForms
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
SetElipseRegion();
}
//setting the form's Region (probably the form as ellipse)
private void SetElipseRegion()
{
Rectangle itsme1 = this.ClientRectangle;
using( GraphicsPath itsme2 = new GraphicsPath())
{
itsme2.AddEllipse(itsme1);
this.Region = new Region(itsme2);
}
}
//using the mouse events to move the form around
Point its1 = Point.Empty;
//when the user clicks on the form's client area, the MoseDown event fires
private void Form1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left) return;
its1 = new Point(e.X, e.Y);
}
//when the user moves the mouse, MouseMove Event fires
private void Form1_MouseMove(object sender, MouseEventArgs e)
{
if (its1 == Point.Empty) return;
Point location = new Point(this.Left + e.X - its1.X, this.Top + e.Y - its1.Y);
this.Location = location;
}
//MouseUp event fires to stop the move
private void Form1_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left) return;
its1 = Point.Empty;
}
}
}
So I wourld like to create a nonrectangular dorm. Can somebody help me.