Is there a way to add my own button inside a normal edit control?
Let's say if I have a standard EDIT generic control in my MFC based dialog:
I'm looking for a way to add a small "X" (or remove) button inside it (here's my Photoshop rendering of what I need):
Is there a way to do this by changing the default control?
source to share
If I wanted more than one button, I would research alternatives:
-
See the code
CMFCEditBrowseCtrl
class. Then decide if you are extracting a class from it and extending; or output from CEdit, copy the codeCMFCEditBrowseCtrl
and expand. -
The fact is that editing is multi-line, I would investigate the CEdit :: SetRect and CEdit :: SetRectNP methods . This is a one-liner case, I would look at CEdit :: SetMargins . Then implement regular buttons above the text edit area.
source to share