|
-
Feb 12th, 2013, 04:49 PM
#1
Thread Starter
Hyperactive Member
Desktop is showing when form is closed
In the main window of my program, load form and display as modal like following.
Dim frm As New form1
frm.ShowDialog()
When close from form1 by Me.Dispose(), desktop(background) is showing in a flash.
It looks like this.
mainform=>form1=>close form1=>(display desktop)=>mainform
Flickering occurs at (display desktop)
You can see this symptom when you open Windows Explorer on the background.
I don't know why this happens.
Can anybody give me some advice?
Here is my code
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm As New form2
frm.ShowDialog(Me)
End Sub
End Class
Public Class Form2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Close()
End Sub
End Class
Last edited by jdy0803; Feb 12th, 2013 at 05:44 PM.
-
Feb 13th, 2013, 11:36 AM
#2
Re: Desktop is showing when form is closed
Are you doing a lot of work in Form1.Activate, or after the ShowDialog call in Form1? Neither seems a likely problem, but if you are doing lots of activity as a result of closing Form2, it may be that Form1 doesn't get to paint very fast. Of course, if the code you showed is really all there is to it, then that isn't the problem in any way.
My usual boring signature: Nothing
 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|