Created
January 31, 2014 13:26
-
-
Save sayurin/8732064 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#r "System.Drawing.dll" | |
#r "System.Windows.Forms.dll" | |
open System.Drawing | |
open System.Windows.Forms | |
Application.EnableVisualStyles() | |
Application.SetCompatibleTextRenderingDefault false | |
let form = new Form(ClientSize = Size(284, 261), Text = "ダイアログジェネレーター") | |
let caption = new TextBox(Location = Point(13, 13), Size = Size(259, 19), Anchor = (AnchorStyles.Top ||| AnchorStyles.Left ||| AnchorStyles.Right)) | |
let text = new TextBox(Location = Point(13, 39), Size = Size(259, 133), Anchor = (AnchorStyles.Top ||| AnchorStyles.Left ||| AnchorStyles.Right), Multiline = true) | |
let combo = new ComboBox(Location = Point(13, 181), Size = Size(121, 20), DropDownStyle = ComboBoxStyle.DropDownList, FormattingEnabled = true) | |
combo.Items.AddRange [| MessageBoxButtons.OK; MessageBoxButtons.OKCancel; MessageBoxButtons.YesNo; MessageBoxButtons.YesNoCancel |] | |
let button = new Button(Location = Point(196, 179), Size = Size(75, 23), Anchor = (AnchorStyles.Top ||| AnchorStyles.Right), Text = "生成", UseVisualStyleBackColor = true) | |
button.Click.Add(fun _ -> MessageBox.Show(text.Text, caption.Text, combo.SelectedItem :?> MessageBoxButtons) |> ignore) | |
form.Controls.AddRange [| caption :> Control; text :> Control; combo :> Control; button :> Control |] | |
form.Controls.Add text | |
form.PerformLayout() | |
Application.Run form |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment