469,602 Members | 1,747 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,602 developers. It's quick & easy.

How to change shape of button to a polygon?Following Approach not Working

1
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

public class MyPolygonButton
{
public MyPolygonButton()
{
}

protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
{
Bitmap bm = new Bitmap(this.Width, this.Height, e.Graphics);
Graphics g = Graphics.FromImage(bm);
g.FillPolygon(Brushes.LightGray, new Polygon(0, 0, bm.Width, bm.Height));
e.Graphics.FillPolygon(Brushes.LightGray, new Polygon(0, 0, this.Width, this.Height));
}

}
Jan 1 '11 #1
0 1023

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by guiromero | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.