There's a much easier way to round the edges of a windows control. Use the
Windows API function CreateRoundRectRgn(). The abbreviated example below
shows how to do it to a form.
yourform.cs
....
using System.Runtime.InteropServices;
....
[DllImport("Gdi32.dll", EntryPoint="CreateRoundRectRgn")]
private static extern IntPtr CreateRoundRectRgn
(
int nLeftRect, // x-coordinate of upper-left corner
int nTopRect, // y-coordinate of upper-left corner
int nRightRect, // x-coordinate of lower-right corner
int nBottomRect, // y-coordinate of lower-right corner
int nWidthEllipse, // height of ellipse
int nHeightEllipse // width of ellipse
);
public Form1() // Your form's or other control's constructor
{
InitializeComponent();
Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0,
Width-10, Height-10, 20, 20)); // adjust these parameters to get the look
you want.
}
....
ShaneB