C# winform this.Visible = false后出现一个短暂的白屏

2025-01-06 01:45:32
推荐回答(3个)
回答1:

你写了Thread.Sleep(1000);这一句,这个是让线程暂停1秒啊,你要不就另外写一个线程来执行,要不你就不要这一句试试

回答2:

this.Visible = false;
this.pictureBox1.Visible = false;
this.pictureBox2.Visible = false;
这3句代码没必要写, 你可以在这三个控件的属性里面直接把visible设置成false;

回答3:

this.Visible = false;
this.pictureBox1.Visible = false;
this.pictureBox2.Visible = false;
this.form2.hangupcall();
Application.DoEvents();
Thread.Sleep(1000);

this.Visible = true;
this.pictureBox1.Visible = true;
this.pictureBox2.Visible = false;