How do I define this in C# code so it is created at runt开发者_StackOverflow中文版ime?
<Button Canvas.Left="100" Canvas.Top="380" Content="Answer" Height="23" Name="submit_btn" Width="75" Click="submit_btn_Click" />
var b = new Button { Text = "Hello World", Left = 100, Top = 100, Width = 50, Height = 25 };
Controls.Add(b);
Place in constructor after InitializeComponent().
精彩评论