1)in the edit box control... how can change colors of some words, and make some words bald... etc...
like the IDE does for: reserved words.
2) also, how do clear,cut,copy the content of the edit box?
thank a milion guys.
Printable View
1)in the edit box control... how can change colors of some words, and make some words bald... etc...
like the IDE does for: reserved words.
2) also, how do clear,cut,copy the content of the edit box?
thank a milion guys.
1) You can't do that with an edit control, you'll have to either use a rich edit control or create your own control
2)
1. To clear the contents, you can either send SetWindowText with a pointer to a NULL, or select everything with EM_SETSEL then EM_REPLACESEL the selection with a pointer to a NULL (obviously use the first one).
2. To cut, create a buffer that will persist beyond the termination of the current function, (ie, it should be part of the class you're using, or a global buffer), put the current selection in it by using EM_GETSELTEXT, then use EM_REPLACESEL with a pointer to a NULL.
3. For copy, do the above except without the EM_REPLACESEL part.
I hope that's clear enough, even though it's probably not, because it's late and I'm really drunk. Hee hee.
EDIT: some crazy .......... I wrote and then edited out.
Hello,
You can also use the clipboard.
Have Fun!Code:/* hEdit is the hwnd of the edit control */
case M_EDIT_UNDO:
SendMessage(hEdit,EM_UNDO,0,0);
break;
case M_EDIT_CUT:
SendMessage(hEdit,WM_CUT,0,0);
break;
case M_EDIT_COPY:
SendMessage(hEdit,WM_COPY,0,0);
break;
case M_EDIT_PASTE:
SendMessage(hEdit,WM_PASTE,0,0);
break;
case M_EDIT_DEL:
SendMessage(hEdit,WM_CLEAR,0,0);
break;
case M_EDIT_SELALL:
SendMessage(hEdit,EM_SETSEL,0,-1);
break;