((CButton*)GetDlgItem(按鈕ID))->EnableWindow(FALSE);//禁用按鈕 ((CButton*)GetDlgItem(按鈕ID))->EnableWindow(TRUE);//啟用按鈕
範例:
GetDlgItem(IDC_RADIO)->EnableWindow(TRUE); GetDlgItem(IDC_EDIT6)->EnableWindow(TRUE);環境:MFC 2015
((CButton*)GetDlgItem(按鈕ID))->EnableWindow(FALSE);//禁用按鈕 ((CButton*)GetDlgItem(按鈕ID))->EnableWindow(TRUE);//啟用按鈕
範例:
GetDlgItem(IDC_RADIO)->EnableWindow(TRUE); GetDlgItem(IDC_EDIT6)->EnableWindow(TRUE);環境:MFC 2015
#include <iostream> #include<stdlib.h> #include <time.h>
srand(time(NULL));//此行每次都加表示每次都會重新刷新
int tenbuf = int((rand() % 10) + 1);//1~10 int hubuf = int((rand() % 100) + 1);//1~100
測試環境 mfc c++空專案
CONVERT ( data_type [ ( length ) ] , expression [ , style ] ) CONVERT style參數說明 1 (expression為 money 或 smallmoney型別): 0 : 預設,保留小數位後兩位,並四捨...