Remove the ability to resize an image pasted into a richtextbox and add an event to that image. C#

匆匆过客 提交于 2019-12-13 06:44:58

问题


I have searhed high and low for a solution to this problem. I have no problem adding an Bitmap image into the richtextbox. The problem is that I don't want it to have the resize option to it. I want that one image to be SELECTED when I click on it, just like in most messengers, and to throw an onclick event. Any help in this area would be greatly appreciated.


回答1:


Here is a question about inserting an image manually building the RTF code. I suspect for any sort of custom functionality you will have to build the RTF for it as well. How can I insert an image into a RichTextBox?

Here is the RTF Spec documentation:

http://msdn.microsoft.com/en-us/library/aa140277%28office.10%29.aspx




回答2:


I had the same problem and found the following solution: Insert images/objects using IRichEditOle. http://www.codeproject.com/KB/edit/MyExtRichTextBox.aspx explains how to do it.



来源:https://stackoverflow.com/questions/2390126/remove-the-ability-to-resize-an-image-pasted-into-a-richtextbox-and-add-an-event

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