Insert Image at Cursor Position in Rich Text box

前端 未结 3 1558
-上瘾入骨i
-上瘾入骨i 2020-12-17 01:34

I know there are various questions like this but i\'m asking because i couldn\'t understand all the answers give. I have RichTextBox and i want the user to be a

3条回答
  •  借酒劲吻你
    2020-12-17 02:30

    RichTextBox' support for OLE (Object Linking and Embedding) is an historical accident. OLE is a dead technology and has been heavily deprecated for many years now. It's death-knell certainly was .NET completely not supporting it. Removing OLE support from the native RichEdit control would have been wise but it would have broken too many ancient apps. The .NET RichTextBox class itself is just a small wrapper for the native component and doesn't add or subtract features from that component.

    Accordingly, there is not any simple way to use the OLE api in .NET. The fact that copy/pasting through the clipboard still works is just an accident, .NET is not involved with that operation so is otherwise powerless to stop it.

    So yes, it still works through the clipboard and is the only decent way to use the feature. There are certainly better alternatives, something like WebBrowser or Word interop gives you much more flexibility. PDF wrappers are popular. WPF supports compound documents well. Etcetera.

提交回复
热议问题