how to insert image in a textbox

2020-07-05 06:12发布

Is there a way to insert an image in a textbox? I'm working on a chat application. And I want to change the values ":)", ":(" etc. with icon images. But I couldn't find that how can I insert image in a textbox?

Thanks.

2条回答
Anthone
2楼-- · 2020-07-05 06:57

If you are using RichTextBox for chat than look at Paste method

  Bitmap bitmap = new Bitmap();
  Clipboard.SetDataObject(bitmap );

  DataFormats.Format format= DataFormats.GetFormat (DataFormats.Bitmap);
  richTextBox.Paste(format);
查看更多
登录 后发表回答