mainFormとhelperFormという名前の 2 つのフォームがあります。mainForm にはボタンがあり、helperForm には richTextBox があります。私がやりたいことは次のとおりです。mainForm のボタンがクリックされたら、helperForm とリッチテキスト ボックスにテキストを表示したいと思います。以下のコードでは、ヘルパー フォームを表示できますが、ボタンの後に来るテキストは、buttonClickイベント内のすべてのプロセスを終了します...
メインフォーム
public partial class Form : Form
{
public HelperForm helperForm;
public MainForm()
{
InitializeComponent();
}
public void button_Click(object sender, EventArgs e)
{
helperForm= new HelperForm ();
helperForm.Show();
helperForm.richTextBox1.AppendText("Program started");
//doing process1
helperForm.richTextBox1.AppendText("Program start to check process1");
//doing process2
helperForm.richTextBox1.AppendText("Program start to check process2");
//doing process3
helperForm.richTextBox1.AppendText("Program start to check process3");
//doing process2
helperForm.richTextBox1.AppendText("All the process are done!");
helperForm.Close();
}