基于C#.net windows的应用程序.. [英] C#.net windows based application..

查看:81
本文介绍了基于C#.net windows的应用程序..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

没关系





class textbox:TextBox

{

protected override void InitLayout()

{

base.InitLayout();

BackColor = Color.Beige;

}

}

班级实验室:标签

{

protected override void InitLayout()

{

base.InitLayout();

BackColor = Color.Beige;

}

}









我怎样才能将这个课程用于所有形式的标签控件........... like label1,label2,label3,

llbtime,lblname,lblcity ...... etc



和文本框.......



如何申请或调用此方法...

that's ok


class textbox :TextBox
{
protected override void InitLayout()
{
base.InitLayout();
BackColor = Color.Beige;
}
}
class lab :Label
{
protected override void InitLayout()
{
base.InitLayout();
BackColor = Color.Beige;
}
}




how can i use this class for all the label controls in the form...........like label1, label2, label3,
llbtime, lblname, lblcity...etc

and textbox .......

how can i apply or call this method...

推荐答案

最简单的方法就是将它们从工具箱拖到设计图面而不是标准标签上。编译完程序集后,它应该出现在工具箱顶部的一个部分中。
Easiest way is just to drag them from the toolbox onto the design surface instead of the standard label. Once you have compiled the assembly, it should appear in a section at the top of the toolbox.


作为OriginalGriff帖子的补充,

如果组件没有不会出现在工具箱中,从你的项目中获取bin(dll)并将其放在工具箱中,控件现在可能会出现。



你需要在要使用标签的表单中重新创建控件(如果存在)。
As a complement to OriginalGriff post,
if the component don't appear in the toolbox, get the bin (dll) from you project and drop it in the tool box, the control may appear now.

You'll need to recreate your controls in the forms you want to use the label, if they exist.


这篇关于基于C#.net windows的应用程序..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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