c#winform 的所有控件缩写是啥

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c#winform 的所有控件缩写是啥相关的知识,希望对你有一定的参考价值。

label,textbox,combox等等
请写全点

楼主是要问组件的命名前缀怎么写吗。
其实它不是背下来的,
是有一定规律的。

命名方法:

1.从组件类型名中移去T前缀。例如TButton变成Button。

2.除了第一个元音,删去所有元音字母。例如,Button变成bttn,Edit变成edt。

3.压缩双字母。例如,bttn变成btn。

4.如相同前缀名导致发生冲突,则在某一组件前缀中加入一个元音。例如在TButton组件的前缀中加入元音变为
batn,以区别Button的前缀。
5.用不用皆可:去掉一些普遍重复的部分,例如textbox按照前上3条的说明应该书写为txtbx,但是box一词是很多组件共同拥有的词条,所以被去掉,缩写为“txt”。

几个例子:
label —— lbl
textbox —— txt 或 txtbx
combox —— cmbx
TListBox —— lstbx
参考技术A 这些是我们公司的一些C#编程规范
主要控件名简写对照表
控件名 简写
Label lbl
TextBox txt
Button btn
LinkButton lnkbtn
ImageButton imgbtn
DropDownList ddl
ListBox lst
DataGrid dg
DataList dl
CheckBox chk
CheckBoxList chkls
RadioButton rdo
RadioButtonList rdolt
Image img
Panel pnl
Calender cld
AdRotator ar
Table tbl
RequiredFieldValidator rfv
CompareValidator cv
RangeValidator rv
RegularExpressionValidator rev
ValidatorSummary vs
CrystalReportViewer rptvew本回答被提问者采纳

c# winform如何取得一个区域的所有控件对象

我有一个pictureBox对象,然后在区域里会加入若干其他对象(如其他picturebox),想取得里面picturebox的名字(可能不止一个) 怎么获取里面的picturebox对象 注意:pictureBox不是容器,所以没有“子控件”

参考技术A 设pictureBox1为父控件 pictureBox2为子控件 //设置pictureBox1可以有子控件 this.pictureBox1.HasChildren = true; //设置pictureBox1在窗体中的位置 this.pictureBox1.Location = new System.Drawing.Point(38, 67); this.pictureBox1.Size = new System.Drawing.Size(236, 196); //设置pictureBox2的父控件为pictureBox1 this.pictureBox2.Parent = this.pictureBox1; //检索指定位置的子控件 //GetChildAtPoint获取制定位置的子控件 this.pictureBox2.Parent = this.pictureBox1; PictureBox[] ps = new PictureBox[10]; int i = 0; for (int x = 0; x < this.pictureBox1.Width; x++) for (int y = 0; y < this.pictureBox1.Height; y++) if(this.pictureBox1.GetChildAtPoint(new Point(x,y)) != null) ps[i] = new PictureBox(); ps[i] = (PictureBoxthis.pictureBox1.GetChildAtPoint(new Point(x, y)); i++;

以上是关于c#winform 的所有控件缩写是啥的主要内容,如果未能解决你的问题,请参考以下文章

C#winform怎样等所有控件加载完再显示窗体?C#透明窗体显示时闪现黑块怎么解决?

在C#winform中如何遍历子窗体中有容器中的所有的控件

C#winform怎样等所有控件加载完再显示窗体?C#透明窗体显示时闪现黑块怎么解决?

C#winform的DataGridView问题

c # 初学者 win32 API转型者,c# 的winform的消息机制是啥?以及它的主线,为啥没有消息循环??

c# winforms GetCurrentDirectory 返回 C:\WINDOWS\System32\ 设计错误