MFC-SetWindowText设置控件文本

阅读 124

2022-11-26

MFC-SetWindowText设置控件文本_控件

 全局函数

CWnd* pWnd = GetDlgItem(IDC_BUTTON2);
HWND hWnd = pWnd->GetSafeHwnd();//CWnd*转化为HWND
::SetWindowText(hWnd,_T("测试"));//设置控件文本
//::全局作用域
//参数1:HWND窗口句柄
//参数2:文本字符串

MFC-SetWindowText设置控件文本_全局函数_02

 

MFC内部函数

CWnd* pWnd = GetDlgItem(IDC_BUTTON2);
pWnd->SetWindowText(_T("CESI"));

MFC-SetWindowText设置控件文本_git_03

 

  

 

 

 

 


精彩评论(0)

0 0 举报