开发者

How do I dynamiclly define this button?

开发者 https://www.devze.com 2023-02-16 15:55 出处:网络
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=\"7

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().

0

精彩评论

暂无评论...
验证码 换一张
取 消