Is there a way to add my own button inside the edit common control?

断了今生、忘了曾经 提交于 2019-12-07 12:37:26

Please consider using new class CMFCEditBrowseCtrl. It does have method CMFCEditBrowseCtrl::EnableBrowseButton() to do exactly what you need.

If I wanted more than one button, I would investigate alternatives:

  • See the CMFCEditBrowseCtrl class' code. Then decide if derive a class from it and extend; or else derive from CEdit, copy CMFCEditBrowseCtrl code and extend.

  • Case the edit is multi-line, I would investigate the methods CEdit::SetRect and CEdit::SetRectNP. Case it is single-line I would look to CEdit::SetMargins. Then implement normal buttons over the text area of the edit.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!