2013-10-22 2 views
0

지금이 문제를 몇 시간 동안 풀려고 노력하고 있으며 실망 스럽지만 여기 누구든지 나를 도울 수 있기를 바랍니다!Keypress 이벤트 & 텍스트 상자 & 리치 텍스트 상자의 텍스트 삭제

내가 무엇을하려하는지, 내가 입력 한 단어를 검색 한 후에 텍스트 상자에서 텍스트를 지우고, 새로운 단어를 검색 할 때 그 안에있는 내용을 삭제하는 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는 다시 검색 할 때마다 이전 검색을 지워야합니다.

나는이 매우 간단하다 생각하지만, havent 한이 :

가 사전에 감사 콘솔에 사용되는 이상 2-3 일 동안은 GUI와 함께 일!

오, btw, 그렇지 않으면 모든 것이 정상적으로 작동해야합니다.

답변

1

좋습니다 ... 검색 값을 검색 한 후에 둘 다 지우기 만할까요?

string playerName = this.inputText.Text; 
this.inputText.Clear(); 
richTextBox1.Clear(); 
// ... rest of your code ... 
+0

시도해보십시오 :) – Winkz

+0

하하 나는 그것이 간단하다는 것을 알았습니다. – Winkz

관련 문제