Micki-Weaver
asked on
make a hole in a form??
how do I creat a hole in a form??
Not sure what you're asking - do you mean an "empty" spot when rendered?
ASKER
.Net, C# if you would but VB is ok
a hole in a form
a hole in a form
If you set the TransparencyKey, and have a region that is a that color, there will be a hole bored through the form.
Bob
Bob
ASKER
I can't allways count on having control of the TransparencyKey, or form backcolor, any other ways??
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
a upgrade and in C#
public static void MakeHole(System.Windows.Fo rms.Form FormIN, System.Drawing.Rectangle RectangleIN)
{
System.Drawing.Size SizeIN = FormIN.Size;
System.Drawing.Drawing2D.G raphicsPat h gp = new System.Drawing.Drawing2D.G raphicsPat h();
// start with a rectangle that represents the whole form
gp.AddRectangle(new Rectangle(0, 0, SizeIN.Width, SizeIN.Height));
// add an ellipse...which is removed from the rectangle above
int w = FormIN.Width / 4;
int h = FormIN.Height / 4;
gp.AddEllipse(RectangleIN) ;
// create a Region from the GraphicsPath and set it...
FormIN.Region = new Region(gp);
}
public static void MakeHole(System.Windows.Fo
{
System.Drawing.Size SizeIN = FormIN.Size;
System.Drawing.Drawing2D.G
// start with a rectangle that represents the whole form
gp.AddRectangle(new Rectangle(0, 0, SizeIN.Width, SizeIN.Height));
// add an ellipse...which is removed from the rectangle above
int w = FormIN.Width / 4;
int h = FormIN.Height / 4;
gp.AddEllipse(RectangleIN)
// create a Region from the GraphicsPath and set it...
FormIN.Region = new Region(gp);
}