您的位置:首页 > 编程语言 > C#

C#控件命名规则

2012-03-31 13:24 330 查看
Control Type Prefix      Example

Button btn btnOK

Grid grd    grdPrices

3D Panel pnl    pnlGroup

ADO Data ado adoBiblio

Animated button ani    aniMailBox

Check box chk chkReadOnly

Combo box cbo cboEnglish

Dropdown list box ≥ ddl ddlUser

Command button cmd cmdExit

Common dialog dlg    dlgFileOpen

Communications com comFax≤

Control (used within procedures when the specific type is unknown)

                     ctr    ctrCurrent

Data dat    datBiblio

Data-bound combo box dbcbo dbcboLanguage

Data-bound grid dbgrd dbgrdQueryResult

Data-bound list box dblst dblstJobType

Data combo dbc dbcAuthor

Data grid dgd dgdTitles

Data list dbl    dblPublisher

Data repeater drp     drpLocation

Date picker dtp    dtpPublished

Directory list box dir    dirSource

Drive list box drv    drvTarget

File list box fil    filSource

Flat scroll bar fsb    fsbMove

Form frm frmEntry

Frame fra    fraLanguage

Gauge gau gauStatus

Graph gra   graRevenue

Hierarchical flexgrid flex flexOrders

Horizontal scroll bar hsb    hsbVolume

Image img imgIcon

Image combo imgcbo imgcboProduct

ImageList ils    ilsAllIcons

Label lbl    lblHelpMessage

Lightweight check box lwchk lwchkArchive

Lightweight combo box lwcbo lwcboGerman

Lightweight command button lwcmd lwcmdRemove

Lightweight frame lwfra lwfraSaveOptions

Lightweight horizontal scroll bar lwhsb lwhsbVolume

Lightweight list box lwlst lwlstCostCenters

Lightweight option button lwopt lwoptIncomeLevel

Lightweight text box lwtxt lwoptStreet

Lightweight vertical scroll bar lwvsb lwvsbYear

Line lin    linVertical

List box lst    lstPolicyCodes

ListView lvw lvwHeadings

MAPI message mpm mpmSentMessage

MAPI session mps mpsSession

MCI mci mciVideo

Menu mnu mnuFileOpen

Month view mvw mvwPeriod

MS Chart ch chSalesbyRegion

MS Flex grid msg msgClients

MS Tab mst mstFirst

OLE container ole   oleWorksheet

Option button opt   optGender

Picture box pic   picVGA

Picture clip clp    clpToolbar

ProgressBar prg   prgLoadFile

Remote Data rd rdTitles

RichTextBox rtf   rtfReport

Shape shp   shpCircle

Slider sld   sldScale

Spin spn   spnPages

StatusBar sta   staDateTime

SysInfo sys   sysMonitor

TabStrip tab  tabOptions

Text box txt  txtLastName

Timer tmr tmrAlarm

Toolbar tlb  tlbActions

TreeView tre  treOrganization

UpDown upd  updDirection

Vertical scroll bar vsb vsbRate

ASP.NET控件命名规则

类型
前缀
示例
AdRotator
adrt
adrtTopAd
Button
btn
btnSubmit
Calendar
cal
calMettingDates
CheckBox
chk
chkBlue
CheckBoxList
chkl
chklFavColors
CompareValidator
valc
valcValidAge
CustomValidator
valx
valxDBCheck
DataGrid
dgrd
dgrdTitles
DataList
dlst
dlstTitles
DropDownList
drop
dropCountries
HyperLink
lnk
lnkDetails
Image
img
imgAuntBetty
ImageButton
ibtn
ibtnSubmit
Label
lbl
lblResults
LinkButton
lbtn
lbtnSubmit
ListBox
lst
lstCountries
Panel
pnl
pnlForm2
PlaceHolder
plh
plhFormContents
RadioButton
rad
radFemale
RadioButtonList
radl
radlGender
RangeValidator
valg
valgAge
RegularExpression
vale
valeEmail_Validator
Repeater
rpt
rptQueryResults
RequiredFieldValidator
valr
valrFirstName
Table
tbl
tblCountryCodes
TableCell
tblc
tblcGermany
TableRow
tblr
tblrCountry
TextBox
txt
txtFirstName
ValidationSummary
vals
valsFormErrors
XML
xmlc
xmlcTransformResults
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: