السلام عليكــم ورحمـة الله وبركاتــه ،،
بشكل افتراضي تظهر Dialogs في تطبيقات MFC باللون الرمادي ولكن بالامكان تغيير اللون بالخطوات التاليه :
في الحدث ()BOOL CMyApp::InitInstance
CMyApp هذا هو اسم التطبيق , علينا ايجاد ()BOOL CMyApp::InitInstance
واضافة الكود ((SetDialogBkColor(RGB(255, 0, 0), RGB(0, 255, 0
BOOL CChuApp::InitInstance()
{
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
SetDialogBkColor(RGB(122, 210, 200), RGB(0, 255, 0));
CChuDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}الباراميتر الاول هو لون الفورم والثاني هو لون الكتابه
سوف يظهر الــــ Dialog باللون الاحمر في هذا المثال واي كتابه فوق Dialog باللون الاخضر
.................................................
ارجو ان لا يكون الموضوع قديم :wink: