I have the following code:
Call of the second form
private void updateToolStripMenuItem_Click(object sender, EventArgs e) { Update fm = new Update(); fm.ShowDialog(); }
This is the constructor
public Update() { InitializeComponent(); }
This is load
private void Update_Load(object sender, EventArgs e) { String ver = checkver(); if (ver == "update") { if (RemoteFileExists(dlUrl) == true) { WebClient webClient = new WebClient(); webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed); webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged); webClient.DownloadFileAsync(new Uri(dlUrl), ""); } else MessageBox.Show("An error occurred. Please try later."); } else if (ver == "newest") { MessageBox.Show("You are currently using the newest version."); this.Close(); } else { this.Close(); } }
My problem is that when the result of the function is 2 or 3, the form is displayed in milliseconds and then it closes (blinks). I want the form not to blink. Is it possible?
I tried using this.Hide () , this.Visible = False , but nothing helped.
EDIT: I put the source code EDIT2: add more code
source share