.Net中控件的命名规则

一、基本数据类型前缀 数据类型数据类型简写ArrayarrBooleanblnBytebytCharchrDateTimedtmDecimaldecDouble

一、基本数据类型前缀

数据类型数据类型简写
Arrayarr
Booleanbln
Bytebyt
Charchr
DateTimedtm
Decimaldec
Doubledbl
Integerint
Longlng
Objectobj
Shortshr
Singlesng
Stringstr

二、ADO.NET对象前缀

控件类型控件类型简写
Commandcmd
Connectionconn
DataAdapterda
DataColumndcol
DataReaderdr
DataRelationDrel
DataRowdrow
DataSetds
DataTabletbl
DataViewdv
Parameterparm

三、WinForm Control 命名规范

控件类型控件类型简写
BackgroundWorkerbgw
BindingNavigatorbdn
BindingSourcebds
Buttonbtn
CheckBoxchk
CheckedListBoxclst
ColorDialogcdlg
ComboBoxcbo
ContextMenuStripcms
CrystalReportViewercrv
DataGriddgrd
DataGridViewdgv
DataSetdts
DateTimePickerdtp
DirectoryEntrydre
DirectorySearcherdrs
DomainUpDowndud
ErrorProvidererr
EventLogevl
FileSystemWatcherfsw
FlowLayoutPanelflp
FolderBrowserDialogfbdlg
FontDialogfdlg
Formfrm
GroupBoxgrp
HelpProviderhlp
HscrollBarhsb
ImageListilst
Labellbl
LinkLabelllbl
ListBoxlst
ListViewlvw
MainMenummnu
MaskedTextBoxmtx
MenuStripms
MessageQueuemsq
MonthCalendarcdr
NotifyIconicn
NumeircUpDownnud
OpenFileDialogofdlg
PageSetupDialogpsdlg
Panelpnl
PerformanceCounterpfc
PictureBoxpic
PrintDialogpdlg
PrintDocumentpdc
PrintPreviewControlprv
PrintPreviewDialogppd
Processprc
ProgressBarpgb
PropertyGridprg
RadioButtonrbtn
ReportDocumentrpd
ReportViewerrpv
RichTextBoxrtx
SaveFileDialogsfdlg
SerialPort spt
ServiceControllerscl
SplitContainerspc
Splitterspl
StatusBarstb
StatusStripss
TabControltab
TableLayoutPaneltlp
TextBoxtxt
Timertmr
ToolBartlb
ToolStripts
ToolStripButtontsbtn
ToolStripContainertsc
ToolStripDropDownButtontsddbtn
ToolStripLabeltslbl
ToolStripMenuItemtsmi
ToolStripSeparatortss
ToolStripSplitButtontssbtn
ToolTiptip
TrackBartrb
TreeViewtvw
VscrollBarvsb
WebBrowserwbs

四、WebControl 命名规范

控件类型控件类型简写
Adrotatoradrt
BulletedListblst
Buttonbtn
Calendarcal
CheckBoxchk
CheckBoxListchkl
CompareValidatorvalc
CustomValidatorvalx
DataGriddg
DataListdl
DetailsViewdtv
DropDownListddl
FileUpLoadfup
FormViewfmv
GridViewgrv
HiddenFieldhfld
HyperLinklnk
Imageimg
ImageButtonibtn
ImageMapimap
Labellbl
LinkButtonlbtn
ListBoxlst
Literalltl
Localizeloc
MultiViewmvw
Panelpnl
PlaceHolderplh
RadioButtonrad
RadioButtonListradl
RangeValidatorvalg
RegularExpressionreg
Repeaterrpt
RequiredFieldValidatorvalr
SubStitutionsubs
Tabletbl
TableCelltblc
TableRowtblr
TextBoxtxt
ValidationSummaryvals
Viewvw
Wizardwiz

到此这篇关于.NET控件命名规范的文章就介绍到这了。希望对大家的学习有所帮助,也希望大家多多支持好代码网。

标签: NET 控件 命名 规范