2010-03-03 7 views

Répondre

0

Si vous utilisez WPF alors ceci est assez simple.

Si vous utilisez WinForms, cela est plus difficile, car vous devez remplacer la méthode de dessin de bouton, mais toujours possible.

0
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; 
using System.Drawing.Drawing2D; 

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

     private void Form1_Load(object sender, EventArgs e) 
     { 

      GraphicsPath gp = new GraphicsPath(); 
      gp.AddEllipse(0, 0, 100, 100); 
      this.Region = new Region(gp); 
     } 
    } 
} 
0

J'ai fait avec succès des boutons entourés d'un cercle personnalisés en utilisant PictureBox et la mise en œuvre sur elle le clic (ou MouseClick) Action:

enter image description here

Questions connexes