Question about Buttons in C#

Would this idea be possible?

Page 1 of 1

2 Replies - 5446 Views - Last Post: 21 November 2006 - 09:38 AM Rate Topic: -----

#1 Random English  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 20-November 06

Question about Buttons in C#

Posted 20 November 2006 - 11:47 AM

Hi, I'm brand new to C# programming, and I was wondering: is it possible to create a button on a Windows form that, rather than looking like a button, is drawn as a shape? For example, this pie wedge.

private void Form1_Paint(object sender, 
			System.Windows.Forms.PaintEventArgs e)
		{
			Pen myPen = Pens.Black;
			Brush myBrush = Brushes.Red;
			float num = 0f;
			float sweep = 22.5f;
			Rectangle myRect = new Rectangle (80, 80, 300, 300);
			e.Graphics.FillPie(myBrush, myRect, num, sweep);
			e.Graphics.DrawPie(myPen, myRect, num, sweep);
		 }



Because I need to have pie wedges that the user can click on and cause something to occur. So I was wondering if it can be done using buttons or if I need to pursue some other way...

This post has been edited by Random English: 20 November 2006 - 11:49 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Question about Buttons in C#

#2 ReggaetonKing  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 4
  • View blog
  • Posts: 73
  • Joined: 16-November 06

Re: Question about Buttons in C#

Posted 20 November 2006 - 09:57 PM

Check it out!
https://secure.codep...colorbutton.asp
A little googling wouldn't hurt cha but hope this helped!

This post has been edited by ReggaetonKing: 20 November 2006 - 09:58 PM

Was This Post Helpful? 0
  • +
  • -

#3 Random English  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 20-November 06

Re: Question about Buttons in C#

Posted 21 November 2006 - 09:38 AM

View PostReggaetonKing, on 20 Nov, 2006 - 11:57 PM, said:

Check it out!
https://secure.codep...colorbutton.asp
A little googling wouldn't hurt cha but hope this helped!


Ohh, thank you so much.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1