1.右擊控件屬性,
在DoDataExchange函數裏面綁定EDIT控件變量
DDX_Control(pDX, IDC_EDIT3, m_txt_SN);
補充:在此之前,需要在頭文件裏面定義EDIT控件的變量名稱
CEdit m_txt_SN;
2.在OnInitDialog()函數裏面設置填入的字體大小
CFont * f;
f = new CFont;
f->CreateFont(
50, // nHeight
0, // nWidth
0, // nEscapement
0, // nOrientation
FW_BOLD, // nWeight
TRUE, // bItalic
FALSE, // bUnderline
0, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
_T("Arial") // lpszFac
);
m_txt_SN.SetFont(f);
m_txt_SN.SetWindowText("");
this->SetWindowText("雲喇叭三元組下載工具");//設置標題
3.如要獲取EDIT控件的值,只需 輸入
CString strValue;
m_txt_SN.GetWindowText(strValue);
即可。
如要設置控件裏面的值,需要輸入
m_txt_SN.SetWindowText(strValue);