页面闪烁但不消失 [英] Page is blinking but not disappear

查看:77
本文介绍了页面闪烁但不消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设计并开发了屏幕,但是单击任何按钮后页面都会闪烁,就像刷新页面一样.

I have designed and developed the screen but on clicking any button page is blinking just like refreshing a page.

推荐答案

您好,我认为问题可能出在通过使用后台工作线程来避免.

BackgroundWorker线程和支持取消 [
Hi, I think that the problem could be avoided by using a background worker thread.

BackgroundWorker Threads and Supporting Cancel[^]

This would leave the UI on its original thread and all the work would be done in the background, that way the UI wont hang or be unresponsive.

Also, make sure you don''t have any recursive calls to your constructor, because if it causes the form to close and then reopen, this could cause that issue also.


您可以最小化页面,或将焦点更改到其他页面.
希望对您有所帮助.

You can either minimize the page, or change focus to different page.
Hope this can help.

private void button1_Click(object sender, EventArgs e)
      {
          this.WindowState = FormWindowState.Minimized;
      }

private void button2_Click(object sender, EventArgs e)
        {
            Form2 f = new Form2();
            this.Hide();
            f.Show();
        }


这篇关于页面闪烁但不消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆