gpt4 book ai didi

c# - 如何更改 richtextbox 默认的蓝色突出显示颜色?

转载 作者:太空宇宙 更新时间:2023-11-03 15:23:46 26 4
gpt4 key购买 nike

我一直在寻找在用户选择文本或事件鼠标移动时更改 richtextbox 突出显示颜色的方法。 Windows 使用蓝色作为默认颜色。但我希望它是绿色并且默认情况下的蓝色不再存在。

  private void richIndicateText_MouseMove(object sender, MouseEventArgs e)
{
richIndicateText.Select(0, 50);
richIndicateText.SelectionBackColor = Color.Green;

}

enter image description here

最佳答案

 this.richIndicateText.MouseClick += new MouseEventHandler(richIndicateText_MouseMove); //hook

this.richIndicateText.MouseClick -= richIndicateText_MouseMove; //unhook

private void richIndicateText_MouseMove(object sender, MouseEventArgs e)
{
richIndicateText.Select(0, 50);
richIndicateText.SelectionBackColor = Color.Green;

}

我会尽力的,也许是这样的?

关于c# - 如何更改 richtextbox 默认的蓝色突出显示颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36214927/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com