C#的winform控件命名规范
本文详细讲述了c#的winform控件命名规范。分享给大家供大家参考。具体如下:
注:这里用红字标记的部分表示有重复出现,括号内为替代表示方案
1.标准控件
序号 |
控件类型简写 |
控件类型 |
1 |
btn |
button |
2 |
chk |
checkbox |
3 |
ckl |
checkedlistbox |
4 |
cmb |
combobox |
5 |
dtp |
datetimepicker |
6 |
lbl |
label |
7 |
llb |
linklabel |
8 |
lst |
listbox |
9 |
lvw |
listview |
10 |
mtx |
maskedtextbox |
11 |
cdr |
monthcalendar |
12 |
icn |
notifyicon |
13 |
nud |
numeircupdown |
14 |
pic |
picturebox |
15 |
prg(pgb) |
progressbar |
16 |
rdo |
radiobutton |
17 |
rtx |
richtextbox |
18 |
txt |
textbox |
19 |
tip |
tooltip |
20 |
tvw |
treeview |
21 |
wbs |
webbrowser |
2.容器控件
序号 |
控件类型简写 |
控件类型 |
1 |
flp |
flowlayoutpanel |
2 |
grp |
groupbox |
3 |
pnl |
panel |
4 |
spl(spc) |
splitcontainer |
5 |
tab |
tabcontrol |
6 |
tlp |
tablelayoutpanel |
3.菜单和工具栏
序号 |
控件类型简写 |
控件类型 |
1 |
cms |
contextmenustrip |
2 |
mns |
menustrip |
3 |
ssr |
statusstrip |
4 |
tsr |
toolstrip |
5 |
tsc |
toolstripcontainer |
4.数据
序号 |
控件类型简写 |
控件类型 |
1 |
dts |
dataset |
2 |
dgv |
datagridview |
3 |
bds |
bindingsource |
4 |
bdn |
bindingnavigator |
5 |
rpv |
reportviewer |
5.对话框
序号 |
控件类型简写 |
控件类型 |
1 |
cld |
colordialog |
2 |
fbd |
folderbrowserdialog |
3 |
fnd |
fontdialog |
4 |
ofd |
openfiledialog |
5 |
sfd |
savefiledialog |
6.组件
序号 |
控件类型简写 |
控件类型 |
1 |
bgw |
backgroundworker |
2 |
dre |
directoryentry |
3 |
drs |
directorysearcher |
4 |
err |
errorprovider |
5 |
evl |
eventlog |
6 |
fsw |
filesystemwatcher |
7 |
hlp |
helpprovider |
8 |
img |
imagelist |
9 |
msq |
messagequeue |
10 |
pfc |
performancecounter |
11 |
prc |
process |
12 |
spt |
serialport |
13 |
scl |
servicecontroller |
14 |
tmr |
timer |
7.印刷
序号 |
控件类型简写 |
控件类型 |
1 |
psd |
pagesetupdialog |
2 |
prd |
printdialog |
3 |
pdc |
printdocument |
4 |
prv |
printpreviewcontrol |
5 |
ppd |
printpreviewdialog |
8.水晶报表
序号 |
控件类型简写 |
控件类型 |
1 |
crv |
crystalreportviewer |
2 |
rpd |
reportdocument |
9.其他
序号 |
控件类型简写 |
控件类型 |
1 |
dud |
domainupdown |
2 |
hsc |
hscrollbar |
3 |
prg |
propertygrid |
4 |
spl |
splitter |
5 |
trb |
trackbar |
6 |
vsc |
vscrollbar |
另一个版本
序号 |
控件类型 |
控件类型简写 |
标准命名举例 |
1 |
label |
lbl |
lblmessage |
2 |
linklabel |
llbl |
llbltoday |
3 |
button |
btn |
btnsave |
4 |
textbox |
txt |
txtname |
5 |
mainmenu |
mmnu |
mmnufile |
6 |
checkbox |
chk |
chkstock |
7 |
radiobutton |
rbtn |
rbtnselected |
8 |
groupbox |
gbx |
gbxmain |
9 |
picturebox |
pic |
picimage |
10 |
panel |
pnl |
pnlbody |
11 |
datagrid |
dgrd |
dgrdview |
12 |
listbox |
lst |
lstproducts |
13 |
checkedlistbox |
clst |
clstchecked |
14 |
combobox |
cbo |
cbomenu |
15 |
listview |
lvw |
lvwbrowser |
16 |
treeview |
tvw |
tvwtype |
17 |
tabcontrol |
tctl |
tctlselected |
18 |
datetimepicker |
dtp |
dtpstartdate |
19 |
hscrollbar |
hsb |
hsbimage |
20 |
vscrollbar |
vsb |
vsbimage |
21 |
timer |
tmr |
tmrcount |
22 |
imagelist |
ilst |
ilstimage |
23 |
toolbar |
tlb |
tlbmanage |
24 |
statusbar |
stb |
stbfootprint |
25 |
openfiledialog |
odlg |
odlgfile |
26 |
savefiledialog |
sdlg |
sdlgsave |
27 |
folderbrowserdialog |
fbdlg |
fgdlgbrowser |
28 |
fontdialog |
fdlg |
fdlgfoot |
29 |
colordialog |
cdlg |
cdlgcolor |
30 |
printdialog |
pdlg |
pdlgprint |
希望本文所述对大家的c#程序设计有所帮助。