Hóa ra phải Gọi hàm AfxInitRichEdit2() thì mới sử dụng được,google mãi mới ra
Ai quan tâm thì đọc thêm tại đây: http://www.codeproject.com/KB/edit/R...px?msg=1674670
Mã nguồn PHP:
BOOL CsdjApp::InitInstance(){//TODO: call AfxInitRichEdit2() to initialize richedit2 library. // InitCommonControlsEx() is required on Windows XP if an application // manifest specifies use of ComCtl32.dll version 6 or later to enable // visual styles. Otherwise, any window creation will fail. INITCOMMONCONTROLSEX InitCtrls; AfxInitRichEdit(); InitCtrls.dwSize = sizeof(InitCtrls); // Set this to include all the common control classes you want to use // in your application. InitCtrls.dwICC = ICC_WIN95_CLASSES; InitCommonControlsEx(&InitCtrls); CWinApp::InitInstance(); AfxEnableControlContainer(); // 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 // Change the registry key under which our settings are stored // TODO: You should modify this string to be something appropriate // such as the name of your company or organization SetRegistryKey(_T("Local AppWizard-Generated Applications")); CsdjDlg dlg; m_pMainWnd = &dlg; INT_PTR 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;}
thay Font và mầu sắc cho CrichEditCtrl:
Mã nguồn PHP:
bool InsertColorRichEditCtrl(__in CHARACTER charTemp,__in int iBreakLine){ CHARFORMAT cf; cf.cbSize = sizeof(CHARFORMAT); cf.dwMask = CFM_FACE | CFM_BOLD | CFM_SIZE | CFM_COLOR; cf.dwEffects = 0; cf.crTextColor = 0; lstrcpy(cf.szFaceName, L"Arial"); cf.yHeight = 300; cf.bCharSet = ANSI_CHARSET; cf.bPitchAndFamily = DEFAULT_PITCH; switch(charTemp.iProperty) { case PROPERTY_KEYDOWN: cf.crTextColor = RGB(0, 0, 0); break; case PROPERTY_KEYUP: cf.crTextColor = RGB(255, 0, 0); break; case PROPERTY_KEYCONTROL_DOWN: cf.crTextColor = RGB(0, 0x99, 0); break; case PROPERTY_KEYCONTROL_UP: cf.crTextColor = RGB(0, 23, 255); break; default: break; } DWORD nInsertionPoint = m_richeditctrl.GetWindowTextLength(); m_richeditctrl.SetSel(nInsertionPoint, -1); m_richeditctrl.SetSelectionCharFormat(cf); TCHAR szTCHAR[MAX_CHARACTER]; mbstowcs (szTCHAR, charTemp.szKeyLog,MAX_CHARACTER); m_richeditctrl.ReplaceSel(szTCHAR); return true;}
Ngọc Bích xanh bản chất thuộc dòng đá đá hoa (jade). Và cẩm thạch là tên gọi chung của ngọc bích. Vì thực chất chúng thuộc dòng đá đa khoáng được hình thành từ chất Silicat dưới dạng dioxy. Ngọc bích...
Chia sẻ Vòng tay ngọc bích xanh là...