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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bajwa
    New Member
    • Jan 2011
    • 1

    #1

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

    using System;
    using System.Collecti ons.Generic;
    using System.Componen tModel;
    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.P aintEventArgs e)
    {
    Bitmap bm = new Bitmap(this.Wid th, this.Height, e.Graphics);
    Graphics g = Graphics.FromIm age(bm);
    g.FillPolygon(B rushes.LightGra y, new Polygon(0, 0, bm.Width, bm.Height));
    e.Graphics.Fill Polygon(Brushes .LightGray, new Polygon(0, 0, this.Width, this.Height));
    }

    }
Working...