Form Flicker / flickering

Posted on 2009-04-27
Last Modified: 2013-11-26

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

Question by:davecocks
    1 Comment
    LVL 1

    Accepted Solution

    I think I've just solved this problem.

    You just select 'Double buffered' to True on the form properties.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
    Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now