如何在WINFORM C#中的所有FORM中添加标签 [英] How to add label in all FORM in WINFORM C#

查看:95
本文介绍了如何在WINFORM C#中的所有FORM中添加标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为大学提出了GPA计算申请。



它包含20多个表格。



现在,我需要添加一些标签&所有形式的图像。



是否可以添加这些标签&所有形式的图像..没有单独输入?







应用链接:

http://www.bitsa.in/2013/06/GPACalc.html [ ^ ]

解决方案

当然:

标签myLabel = 标签(); 
myLabel.Text = // ...
// 对接,布局,位置,无论什么适用......
myLabel.Parent = someParentControl; // 这是关键,这是实际添加标签的方式





为问题中的所有表格执行此操作,例如循环播放。



-SA

I made an application for GPA Calculation for college.

It consists of more than 20 FORMS.

Now, I need to add some label & image to all form.

Is it possible to add these label & image in all form.. Without typing in each for separately?



APPLICATION LINK:
http://www.bitsa.in/2013/06/GPACalc.html[^]

解决方案

Sure:

Label myLabel = new Label();
myLabel.Text = //...
// docking, layout, location, whatever applies...
myLabel.Parent = someParentControl; // this is the key, this is how actually add a label



Do this for all forms in the question, in a loop, for example.

—SA


这篇关于如何在WINFORM C#中的所有FORM中添加标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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