Results 1 to 2 of 2

Thread: Desktop is showing when form is closed

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2012
    Posts
    433

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width