Form Flicker / flickering


wiindows forms application using visual Studio 2008 in    VB.Net     (  .Net 3.5  )

I'm opening a form with the following code. However, it 'flickers' on opening i.e. the background loads up, then the whole forms sort of flashes before the text boxes, datagrid view ect load up.

This form has 3 buttons an empty datagrid view (no records) and a few text boxes and a date picker.

I'm using the dotNetTool bar on my MDI parent form and loading other forms into the parent using a button click.

Any suggestions?

Many thanks,

'The button click to open the form:
'Makes sure no instance of the form before open
        Dim frmDiveSurveyList_frm As frmDiveSurveyList = My.Application.OpenForms("frmDiveSurveyList")
        If frmDiveSurveyList_frm IsNot Nothing Then
            'If the form is open nothing
            Dim openFrmDiveSurveyList As frmDiveSurveyList
            openFrmDiveSurveyList = New frmDiveSurveyList()
            openFrmDiveSurveyList.MdiParent = Me
            ' Dock the form on the parent
            openFrmDiveSurveyList.Dock = DockStyle.Fill
            openFrmDiveSurveyList.WindowState = FormWindowState.Maximized
            openFrmDiveSurveyList.FormBorderStyle = Windows.Forms.FormBorderStyle.None
            'Main_Load.dmaster_open = 1
            openFrmDiveSurveyList = Nothing
        End If
'Form Load
  Private Sub frmDiveSurveyList_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'InternalDataSet.diveDetailsListing' table. You can move, or remove it, as needed.
        'filters the diveDetailsList by todaysDate
        Me.DiveDetailsListingBindingSource.Filter = "diveDate >= #" & _
datePickerSurveyList.Value.Date.ToString("MM/dd/yyyy") & " 00:00:00# and diveDate <= #" & _
datePickerSurveyList.Value.Date.ToString("MM/dd/yyyy") & " 23:59:59#"
        'Shows the no dives message
        If Me.DiveDetailsListingDataGridView.Rows.Count() = 0 Then
            NoDivesLabel.Visible = True
        ElseIf Me.DiveDetailsListingDataGridView.Rows.Count() > 0 Then
            NoDivesLabel.Visible = False
        End If
    End Sub

Open in new window

Who is Participating?
davecocksAuthor Commented:
I think I've just solved this problem.

You just select 'Double buffered' to True on the form properties.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.