删除调整粘贴到 Richtextbox 中的图像大小并向该图像添加事件的功能。 C#
我一直在寻找解决这个问题的方法。将位图图像添加到 Richtextbox 中没有问题。问题是我不希望它有调整大小选项。我希望当我单击该图像时,它会被选中,就像在大多数即时通讯程序中一样,并引发 onclick 事件。在此领域的任何帮助将不胜感激。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我遇到了同样的问题并找到了以下解决方案:使用 IRichEditOle 插入图像/对象。 http://www.codeproject.com/KB/edit/MyExtRichTextBox.aspx解释了如何做。
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.
这是一个关于手动构建 RTF 代码插入图像的问题。我怀疑对于任何类型的自定义功能,您都必须为其构建 RTF。
如何将图像插入到 RichTextBox 中?
以下是 RTF 规范文档:
http://msdn .microsoft.com/en-us/library/aa140277%28office.10%29.aspx
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