Click here to Skip to main content
15,849,615 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi friends

How to create and arrange button in circular position programmatically.

please follow the link to see what i want actually.

http://www.facebook.com/photo.php?fbid=319740671377760&set=a.233086813376480.61723.100000254892966&type=1&theater[^]

[edit]"Treat my content as plain text..." option disabled to make link work- OriginalGriff[/edit]
Posted
Updated 16-Dec-11 4:41am
v3

1 solution

Create button programably:
C#
Button b = new Button();
b.Text = "Hello";
b.Click += new EventHandler(button_Click);
b.Location = new Point(x, y);
Controls.Add(b);

To work out the (x, y) coordinates, use the normal circle algorithm:
Y = R * Sin(A)
X = R * Cos(A)
   where R is the radius, 
         A is the angle in degrees
 
Share this answer
 
Comments
AmitGajjar 16-Dec-11 10:38am    
good one, didn't try but 5+ for idea...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900