将图像嵌入文本框 [英] Embed image into a textbox

查看:29
本文介绍了将图像嵌入文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Windows 窗体 (.Net 2.0) 应用程序,我有一个请求,将一些自定义图像嵌入到一些文本框中(就像新版 Tortoise 所做的那样).

I have a Windows Forms (.Net 2.0) app and I have a request to embed some custom images into some textboxes(like the new version of Tortoise does).

推荐答案

我没有在文本框上使用过OwnerDraw,但我已经在其他控件上使用过它,例如列表框和列表视图,并且我看到其他人这样做了这与文本框.我找到了一个教程,它应该为您指明正确的方向,它本身并不用于在文本框中显示图像,但可以用于:

I haven't used OwnerDraw on a textbox, but I've used it on other controls such as the listbox and listview and I've seen other people do this with textboxes. I found a tutorial that should point you in the right direction, it's not used for displaying images in the textbox per se, but it could be used for that:

http://www.codedblog.com/2007/09/17/owner-drawing-a-windowsforms-textbox/

希望至少能让你开始......

Hopefully that gets you started at least...

这篇关于将图像嵌入文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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