Text editor

Can anyone give me a hint(or link to tutorial) how to change color of text inside "edit" control? I'm trying to make sth like IDE (where keywords become blue), so how to change color of substring which is in edit control?

I'm talking 'bout win32.
You should look into the Scintilla library, it's designed for that.
When I download scintilla, which files do i need and where do i hae to move them?
You could subclass the edit control and colour the text yourself.
1
2
3
4
5
6
7
8
9
10
11
12
(1) Create a new dialog-based (yourself) mfc program
Add an edit control [ID = IDC_EDIT_DEMO], add a button [ID: IDC_BTN_SETCOLOR,]
2. Response IDC_BTN_SETCOLOR button click event handler
 In the previous step before the first in CxxxDlg Add a member variable of type COLORREF [Name: m_clrSel,]
Initialization m_clrSel = RGB (255, 0, 0);
Add the response WM_CTLCOLOR message processing function,
Write the following code
if (IDC_EDIT_DEMO == pWnd-> GetDlgCtrlID ()) / / judgment being drawn is not specified control
{
pDC-> SetTextColor (m_clrSel) ;/ / Set the text color on edit control
return hbr;
}
Topic archived. No new replies allowed.