如何自定义“文本框选择"颜色? [英] How can i customise TextBox Selection color?
问题描述
大家好,
我发现很难(即使不是不可能)找到一种解决方案,以解决如何更改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屋!