如何自定义“文本框选择"颜色? [英] How can i customise TextBox Selection color?

查看:104
本文介绍了如何自定义“文本框选择"颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我发现很难(即使不是不可能)找到一种解决方案,以解决如何更改TextBox控件中的文本选择颜色.

我读过TextBox控件是旧的Windows文本框的薄包装,因此很难绘制.我找到了可以隐藏背景的应用程序,但仍然无法自定义选择颜色=/

有什么方法可以实现自定义选择颜色?是否有Win32电话可以让我执行此操作或其他任何可能性.

任何指针都会有所帮助

在此先感谢George

Hi All,

I am finding it difficult if not impossible to find a solution to how i would change the text selection colour in a TextBox control.

I have read that the TextBox control is a thin wrapper around the old windows text box and is therefore more difficult to paint. I found an application when i could hide the background however still cannot customise the selection color =/

Is there any way i can achieve a custom selection colour? Is there a Win32 call that would allow me to do this or any other possibility.

Any pointers would be helpful

Thanks in Advance George

推荐答案

您是否尝试过
Have you tried
txtTextBox.ForeColoe = Color.Red;



如果是,则必须用RTB(富文本框)替换文本框.

您将能够在这里实现想要实现的目标.



If So then you have to replace your textbox with RTB(rich Text Box).

You will able to achieve what you are trying to achieve here.


这篇关于如何自定义“文本框选择"颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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