1、主要控件名简写对照表ADO.NET命名规范数据类型 数据类型简写 标准命名举例Connection con conNorthwindCommand cmd cmdReturnProductsParameter parm parmProductIDDataAdapter dad dadProductsDataReader dtr dtrProductsDataSet dst dstNorthWindDataTable dtbl dtblProductDataRow drow drowRow98DataColumn dcol dcolProductIDDataRelation drel drelM
2、asterDetailDataView dvw dvwFilteredProductsWinForm Control 命名规范数据类型 数据类型简写 标准命名举例Label lbl lblMessageLinkLabel llbl llblTodayButton btn btnSaveTextBox txt txtNameMainMenu mmnu mmnuFileCheckBox chk chkStockRadioButton rbtn rbtnSelectedGroupBox gbx gbxMainPictureBox pic picImagePanel pnl pnlBodyDataGr
3、id dgrd dgrdViewListBox lst lstProductsCheckedListBox clst clstCheckedComboBox cbo cboMenuListView lvw lvwBrowserTreeView tvw tvwTypeTabControl tctl tctlSelectedDateTimePicker dtp dtpStartDateHscrollBar hsb hsbImageVscrollBar vsb vsbImageTimer tmr tmrCountImageList ilst ilstImageToolBar tlb tlbManag
4、eStatusBar stb stbFootPrintOpenFileDialog odlg odlgFileSaveFileDialog sdlg sdlgSaveFoldBrowserDialog fbdlg fgdlgBrowserFontDialog fdlg fdlgFootColorDialog cdlg cdlgColorPrintDialog pdlg pdlgPrintWebControl 命名规范数据类型 数据类型简写 标准命名举例AdRotator adrt ExampleButton btn btnSubmitCalendar cal calMettingDatesCh
5、eckBox chk chkBlueCheckBoxList chkl chklFavColorsCompareValidator valc valcValidAgeCustomValidator valx valxDBCheckDataGrid dgrd dgrdTitlesDataList dlst dlstTitlesDropDownList drop dropCountriesHyperLink lnk lnkDetailsImage img imgAuntBettyImageButton ibtn ibtnSubmitLabel lbl lblResultsLinkButton lb
6、tn lbtnSubmitListBox lst lstCountriesPanel pnl pnlForm2PlaceHolder plh plhFormContentsRadioButton rad radFemaleRadioButtonList radl radlGenderRangeValidator valg valgAgeRegularExpression vale valeEmail_ValidatorRepeater rpt rptQueryResultsRequiredFieldValidator valr valrFirstNameTable tbl tblCountry
7、CodesTableCell tblc tblcGermanyTableRow tblr tblrCountryTextBox txt txtFirstNameValidationSummary vals valsFormErrorsXML xmlc xmlcTransformResults变量变量的作用域及前缀前缀 说明 举例P 全局变量 pstrNameSt 静态变量 ststrNameM 模块或者窗体的局部变量 MstrNameA 数组 AintCount变量数据类型的前缀C#数据类型 类库数据类型 标准命名举例Sbyte System.sbyte sbteShort System.In
8、t16 shtInt System.Int32 intLong System.Int64 lngByte System.Byte bteUshot System.Uint16 ushtUint System.Uint32 uintUlong System.Uint64 ulngFloat System.Single fltDouble System.Double dblDecimal System.Decimal dclBool System.Boolean bolChar System.Char chrObject System.Object objString System.String strSystem.DateTime dteIntPtr System.Intpre intptr