Visual Studio Control Naming conventions (very detailed)

Source: Internet
Author: User

VS Control Naming conventions

Type Prefix Example

Array arr arrshoppinglist


Boolean bln Blnispostback

Byte byt Bytpixelvalue

Char CHR Chrdelimiter

DateTime DTM Dtmstartdate

Decimal Dec decaverageheight

Double Dbl Dblsizeofuniverse

Integer int Introwcounter

Long LNG Lngbillgatesincome

Object obj Objreturnvalue

Short SHR Shraverage

Single SNG Sngmaximum

String Str strFirstName

WebControls

Type Prefix Example

AdRotator ADRT Adrttopad

Button btn Btnsubmit

Calendar Cal Calmettingdates

CheckBox chk Chkblue

CheckBoxList CHKL chklfavcolors

CompareValidator Valc Valcvalidage

CustomValidator Valx Valxdbcheck

DataGrid GRD 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 XMLC Ransformresults

ado

Type Prefix Example

Connection Con connorthwind

Command cmd cmdreturnproducts

Parameter Parm Parmproductid

DataAdapter dad Dadproducts

DataReader DTR Dtrproducts

DataSet DST Dstnorthwind

DataTable Dtbl dtblproduct

DataRow Drow drowRow98

DataColumn Dcol Dcolproductid

DataRelation Drel Drelmasterdetail

DataView DVW dvwfilteredproducts

Event-handling subroutines
The name of an event-handling subroutine would consist of the ID of the control that rasied the event followed by the type of event being handled. For example, a subroutine named btnSubmit_Click handles the Click event of a Button control named Btnsubmit.
When a control that raises an event was not assigned an ID, the type of the control is used instead of the ID. For example, the subroutine named Button_Click handles the Click event of a Button control without an ID.
I hope you can write code that is consistent in style.

http://blog.csdn.net/yanjiaye520/article/details/5350375

Visual Studio Control Naming conventions (very detailed)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.