この問題を何時間も解決しようとしていて、それが私を苛立たせています。ここにいる誰かが私を助けてくれることを願っています!
私がやろうとしていることは、入力した単語を検索した後にテキストボックスでテキストをクリアし、新しい単語を検索するときにリッチテキストボックスでその中にあるものをすべて削除することです。
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は、再度検索するたびに以前の検索をクリアする必要があります。
これは非常に単純だと思いますが、コンソールに使用される2〜3日以上GUIを使用していません:)
前もって感謝します!
ああ、ところで、それが明確でなかった場合、他のすべては正常に機能します!
わかりました...検索値を取得した後、両方をClear()するだけですか?
string playerName = this.inputText.Text;
this.inputText.Clear();
richTextBox1.Clear();
// ... rest of your code ...
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加