询问者
RichEdit 粘贴的时候怎么能把格式去掉,粗体呀 字号呀等等

问题
全部回复
-
Hi,
感谢在MSDN论坛发帖。
>>RichEdit 粘贴的时候怎么能把格式去掉,粗体呀 字号呀等等?
你可以使用CRichEditCtrl::PasteSpecial函数来选择剪贴板格式, 设置为纯文本格式CF_TEXT。
这里有篇文档关于Rich Edit控件中的剪贴板操作,你可以参考一下。
https://msdn.microsoft.com/en-us/library/9kkaxdez.aspx希望对你有所帮助。
Best Regards,
Sera Yu
MSDN Community Support<br/> Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact <a href="mailto:MSDNFSF@microsoft.com">MSDNFSF@microsoft.com</a>.
- 已编辑 Baron Bi 2017年7月5日 5:46
-
Hi,
感谢在MSDN论坛发帖。
>>RichEdit 粘贴的时候怎么能把格式去掉,粗体呀 字号呀等等?
你可以使用CRichEditCtrl::PasteSpecial函数来选择剪贴板格式, 设置为纯文本格式CF_TEXT。
这里有篇文档关于Rich Edit控件中的剪贴板操作,你可以参考一下。
https://msdn.microsoft.com/en-us/library/9kkaxdez.aspx希望对你有所帮助。
Best Regards,
Sera Yu
MSDN Community Support<br/> Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact <a href="mailto:MSDNFSF@microsoft.com">MSDNFSF@microsoft.com</a>.
-
>>我用的是纯win32的 ,不是mfc的
那你可以响应EM_PASTESPECIAL消息来设置一个特定的剪贴板格式。或者响应EM_SETPARAFORMAT消息用来在rich edit控件中设置当前选择的段落格式。
详细内容可以参考以下文档。
https://msdn.microsoft.com/en-us/library/windows/desktop/hh298393(v=vs.85).aspx
Best Regards,
Sera YuMSDN Community Support<br/> Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact <a href="mailto:MSDNFSF@microsoft.com">MSDNFSF@microsoft.com</a>.