(newbie)displaying a custom button

J

jed

namespace Question_1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();

}

}

public class mybutton : System.Windows.Forms.Button
{
protected override void OnPaint(PaintEventArgs pe)
{
System.Drawing.Drawing2D.GraphicsPath path = new
System.Drawing.Drawing2D.GraphicsPath();
path.AddString("button", Font.FontFamily, (int)Font.Style,
52, new Point(126, 129), StringFormat.GenericDefault);
Region reg = new Region(path);
this.Region = reg;
}
How can i display this button on Form1. please tell me if anything
wrong with code
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top