0

几个小时以来一直试图解决这个问题,这让我很沮丧,希望这里的任何人都可以帮助我!

我想要做的是,我希望文本框在我搜索我输入的单词后清除文本,并在我搜索新单词时删除 Richtextbox 中的任何内容。

       private void button1_Click(object sender, EventArgs e)
    {   

        string downloadedString;
        System.Net.WebClient client;

        string playerName = this.inputText.Text;
        client = new System.Net.WebClient();

        downloadedString = client.DownloadString("http:randomaddress;
        string[] stringSeperator = new string[] { "\n" };
        string[] result;

        result = downloadedString.Split(stringSeperator, StringSplitOptions.None);
        foreach (string s in result)
        {
            Bunch of if statements
        }
    public void SortString(string s)
    {
        //string manipulation
        richTextBox1.Text += manipulate2 + "--" + " ";
    }
    public void SortString2(string s)
    {
        //string manipulation
        richTextBox1.Text += manipulate2 + "--" + " ";
    }
    public void SortString3(string s)
    {
        //string manipulation
        richTextBox1.Text += manipulate2 + "--" + " ";
    }

         private void richTextBox1_TextChanged(object sender, EventArgs e)
    {

    }

    private void textBox1_TextChanged(object sender, EventArgs e)
    {

    }


    private void Form1_Load(object sender, EventArgs e)
    {

    }

    private void True(object sender, PreviewKeyDownEventArgs e)
    {

    }

一直在尝试许多不同的方法,但我无法让它发挥作用.. 但再说一遍我想要什么.. 文本框用于搜索,我从搜索中获得的输入显示在 Richtextbox 中。输入单词并搜索后应该清除搜索词,并且每次我再次搜索时richtextbox都需要清除以前的搜索。

我想这很简单,但没有使用 GUI 超过 2-3 天,用于控制台:)

先感谢您!

哦,顺便说一句,如果不清楚,其他一切都应该正常工作!

4

1 回答 1

1

好的...在您检索到搜索值后,只需清除()它们吗?

string playerName = this.inputText.Text;
this.inputText.Clear();
richTextBox1.Clear();
// ... rest of your code ...
于 2013-10-22T16:30:52.343 回答