如何在程序中动态改变一个button的caption属性

解决方案 »

  1.   

    察看CButton类,那上面又你要的东西
      

  2.   

    你是用mfc吗?那么你将该button用classwizard将其添为类的成员,该成员为CButton类,例如命名为CButton a,在调用a.SetWindowText(_T("Hockey is best!"));(""中为你要改称的名字)。或者用BOOL SetWindowText( HWND hWnd, LPCTSTR lpString );
    该API函数不论你是不是用的MFC,不过你要得button到窗口句柄
      

  3.   

    利用SetWindowText()函数即可