按下控制键时 RichTextBox 选择错误 [英] RichTextBox selection bug when pressing control key

查看:39
本文介绍了按下控制键时 RichTextBox 选择错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 RichTextBox 中的文本选择有一个非常奇怪的错误:

I have a very strange bug with text selection in RichTextBox :

我创建了以下简单的表单:

I create the following simple form :

public partial class Form1 : Form
{
    public Form1()
{
    InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        richTextBox1.Text = "Tempore quo primis auspiciis in mundanum fulgorem surgeret victura dum erunt homines Roma, ut augeretur sublimibus incrementis, foedere pacis aeternae Virtus convenit atque Fortuna plerumque dissidentes, quarum si altera defuisset, ad perfectam non venerat summitatem.";
    }
}

启动应用程序时,我可以选择 RichTextBox 中的文本,直到我按下控制键.

When launching the app I can select the text in the RichTextBox until I press the control key.

RichTextBox 不再可选,直到我在应用程序外单击几次.

The RichTextBox is then no longer selectable until I click several times outside the application.

我听说 AutoWordSelection 的愚蠢错误,但我尝试了这个技巧,但没有成功.

I hear about silly bug with AutoWordSelection but I tried the trick without success.

我在 Windows 8 上使用 Framework .Net v4.

有人知道吗?

推荐答案

Mybe 将文本放在应用程序之外.对我有用

Mybe put the text outside the application. works good for me

    private void CleaningManual_Load(object sender, EventArgs e)
    {
        RichTB.LoadFile(@"C:\awTextFiles\CleaningManual.rtf");
    }

这篇关于按下控制键时 RichTextBox 选择错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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