Something like

1
2
3
4
5
6
7
open System.Windows.Forms
let numButtons = 5


let buttonArray = Array.init numButtons (fun _ -> new Button())

should do the trick.

If you want to create labeled buttons with index, use this:

1
2
3
let labeledButtonArray = Array.init numButtons (fun i -> new Button(Text = sprintf "Button%d" i))

By on 11/18/2009 12:47 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper