Form Flicker

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael

    Form Flicker

    Here is my problem:

    I have a MDI application and when I load my child forms I get alot of
    flicker.

    I have tried to implement double buffering :
    Public Sub New()
    MyBase.New()

    'This call is required by the Windows Form Designer.
    InitializeCompo nent()

    'Add any initialization after the InitializeCompo nent() call

    ' Stop the flicker
    Me.SetStyle(Con trolStyles.User Paint, True)
    Me.SetStyle(Con trolStyles.Doub leBuffer, True)
    Me.SetStyle(Con trolStyles.AllP aintingInWmPain t, True)
    End Sub

    but it did not work.

    Does anyone have any suggestions?

    Mike


  • Jay B. Harlow [MVP - Outlook]

    #2
    Re: Form Flicker

    Michael,
    My understanding is you need to call UpdateStyles after you call SetStyle.
    [color=blue]
    > Public Sub New()
    > MyBase.New()
    >
    > 'This call is required by the Windows Form Designer.
    > InitializeCompo nent()
    >
    > 'Add any initialization after the InitializeCompo nent() call
    >
    > ' Stop the flicker
    > Me.SetStyle(Con trolStyles.User Paint, True)
    > Me.SetStyle(Con trolStyles.Doub leBuffer, True)
    > Me.SetStyle(Con trolStyles.AllP aintingInWmPain t, True)[/color]
    Me.UpdateStyles ()[color=blue]
    > End Sub[/color]

    Do you child forms override the OnPaint method or have controls? If they
    have controls, I do not believe the above will help, as each control still
    needs to paint itself.

    Hope this helps
    Jay


    "Michael" <michaelschofie ld@sympatico.ca > wrote in message
    news:rPz2b.3374 $Cg2.457330@new s20.bellglobal. com...[color=blue]
    > Here is my problem:
    >
    > I have a MDI application and when I load my child forms I get alot of
    > flicker.
    >
    > I have tried to implement double buffering :
    > Public Sub New()
    > MyBase.New()
    >
    > 'This call is required by the Windows Form Designer.
    > InitializeCompo nent()
    >
    > 'Add any initialization after the InitializeCompo nent() call
    >
    > ' Stop the flicker
    > Me.SetStyle(Con trolStyles.User Paint, True)
    > Me.SetStyle(Con trolStyles.Doub leBuffer, True)
    > Me.SetStyle(Con trolStyles.AllP aintingInWmPain t, True)
    > End Sub
    >
    > but it did not work.
    >
    > Does anyone have any suggestions?
    >
    > Mike
    >
    >[/color]


    Comment

    Working...