使用C#在Windows应用程序中动态创建按钮 [英] dynamically create the button in windows application using c#

查看:75
本文介绍了使用C#在Windows应用程序中动态创建按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助我动态创建按钮....例如,我们无法在设计页面中显示按钮,但是它将在运行时使用Windows窗体显示...

Please help me to create the Button dynamically....for example we cannot show the button in the design page but it will be show in the run time using Windows Form...

推荐答案

看下面的示例,这可能对您有帮助:
have a look at the following example, this might help you:
Button button1 = new Button();
button1.Location = new Point(20,10);
button1.Text = "Click Me";
// adding to groupBox1
groupBox1.Controls.Add(button1);


选中此

http://support.microsoft.com/kb/319266 [向表单动态添加按钮 [使用C#为.NET Framework编写Windows窗体应用程序 [
Check this

http://support.microsoft.com/kb/319266[^]

Dynamically Adding Button to a Form[^]

Writing a Windows Form Application For .NET Framework Using C#[^]


请参阅此链接

在asp.net和c#中动态创建的按钮 [ ^ ]

可能会给你一些想法
Refer this link

Dynamically created button in asp.net and c#[^]

May give you some idea


这篇关于使用C#在Windows应用程序中动态创建按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆