Adding a button type to an existing button

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding a button type to an existing button

Paul Johnson
Hi,

I'm creating buttons dynamically based on results from a database. While
this is a very simple operation, I'm stumped on how to set the button to
have rounded edges.

I'm creating the buttons like this

UIButton foo = new UIButton(new RectangleF(x, y, width, height);

I can't use foo.ButtonType as ButtonType is only a get

Is there a way to set the type once the button has been instantated or
do I need to create the button another way?

Paul
--
"Space," it says, "is big. Really big. You just won't believe how
vastly, hugely, mindbogglingly big it is. I mean, you may think it's a
long way down the road to the chemist's, but that's just peanuts to
space, listen..."
Hitch Hikers Guide to the Galaxy, a truly remarkable book!

_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|

Re: Adding a button type to an existing button

jawbrey
 var button = UIButton.FromType(UIButtonType.RoundedRect);
 button.frame = new RectangleF(x, y, width, height);


On Wed, Jun 5, 2013 at 5:31 AM, Paul Johnson <[hidden email]> wrote:
Hi,

I'm creating buttons dynamically based on results from a database. While this is a very simple operation, I'm stumped on how to set the button to have rounded edges.

I'm creating the buttons like this

UIButton foo = new UIButton(new RectangleF(x, y, width, height);

I can't use foo.ButtonType as ButtonType is only a get

Is there a way to set the type once the button has been instantated or do I need to create the button another way?

Paul
--
"Space," it says, "is big. Really big. You just won't believe how vastly, hugely, mindbogglingly big it is. I mean, you may think it's a long way down the road to the chemist's, but that's just peanuts to space, listen..."
Hitch Hikers Guide to the Galaxy, a truly remarkable book!

_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch


_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch