私は2つのスクリプトを持っています1- Soket.cs(スレッドとのSoketサーバ)FormMain.cs(Working Normal)私はこのコードでsoket.csからFormMainの関数を呼び出します:マルチスレッド/呼び出しに関する問題:(
値メッセージボックスを表示する細かい!!!public void AdverFilter(string value)
{
if (this.InvokeRequired)
{
this.BeginInvoke(new Action<string>(AdverFilter),value);
}
else
{
this.richTextBox1.Text = value;
MessageBox.Show("AdverFilter(string value)");
MessageBox.Show(this.richTextBox1.Text);
}
}
が、そのいけない仕事が、(関数が終了した後に)GUIでヌルrichtextbox.textです:
public void ResiveFunc(string FuncResive)
{
string FuncName = "";
string FuncValue = "";
for (int i = 0; i <= 2; i++)
{
FuncName += FuncResive[i];
}
for (int j = 4; j <= FuncResive.Length - 1; j++)
{
FuncValue += FuncResive[j];
}
MessageBox.Show(FuncName);
MessageBox.Show(FuncValue);
if (FuncName == "TAB")
{
Form1 mainForm = new Form1();
mainForm.AdverFilter(FuncValue);
}
}
iがFormMainでこのAdverFilter()関数を呼び出します。 ..どうすればこの問題を解決できますか?教えてください...
をあなたは本当にマルチthearedしている場合、私は非常に有能な心理学者を求めて提案、あなたのスペルを修正しました。 – TomTom
RichTextBox Textプロパティは読み込み専用ではありませんか? – CodingBarfield
私は他の文字列オブジェクト – user584110