在文本框/richTextBox中绘制图形 [英] Drawing graphics in textbox / richTextBox

查看:69
本文介绍了在文本框/richTextBox中绘制图形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以在textBox或RitchTextBox中绘制图形(线条)吗?

也就是说,我们在RitchTextBox中有文本,我们想在两个单词之间划一条线(在文本框中选择).

Can we draw graphics (lines) inside textBox or RitchTextBox.

i.e. we have text inside a RitchTextBox and we want to draw a line between two of the words (selected in text box)

推荐答案

您不能在RichTextBox上绘制,但您可以通过剪贴板添加图像.

请查看我过去的回答:
如何使用以下方法打开Word文件桌面应用程序中的富文本框中显示图片和项目符号. [
You cannot draw on RichTextBox, but you can add an image through a clipboard.

Please see my past answer:
how to open word file with images and bullets in a rich text box in desktop application.[^].

However, this is so awkward, intrusive (why modifying a Clipboard?) and weak, that I would not recommend to bother.

As to TextBox — just forget it. It would be much easier to make a totally custom control and add some text editing functionality to it. :-)

—SA


否.不是.而且所有者绘制文本框是一个活生生的地狱,因此您甚至无法尝试.
No. It''s not. And owner drawing a textbox is a living hell, so you can''t even try that.


这篇关于在文本框/richTextBox中绘制图形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆