7 Replies - 3389 Views - Last Post: 20 May 2013 - 01:57 AM Rate Topic: -----

#1 xrndMember  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 04-October 12

Flicker Problem on form loading

Posted 04 October 2012 - 08:14 AM

Hello,
I am making an application in vb.net 2012.
I have used split container, table layout panel and panels as container in my form.
I also have buttons, text boxes, tool strip,status strip,combo box, list view etc
the problem is when i load the form it flickers a lot. also when the list view columns width is changed while populating the list view it flickers and which doesn't look good. I have tried few solutions
1) i have set double buffered property to true
2) no container back color is transparent
3) to prevent flicker while loading i used suspendlayout() and resumelayout()

But it just reduced flicker a bit, its not completely gone.

Note: I have added images in table layout

Is This A Good Question/Topic? 0
  • +

Replies To: Flicker Problem on form loading

#2 deery5000  Icon User is offline

  • D.I.C Addict

Reputation: 78
  • View blog
  • Posts: 966
  • Joined: 09-May 09

Re: Flicker Problem on form loading

Posted 05 October 2012 - 03:43 PM

if you have many controls with a transparent background then your going to see flicker. you have taken the right steps although there is one more. look into the onPaint event as this is called last.

Hope this helps
Kevin
Was This Post Helpful? 0
  • +
  • -

#3 xrndMember  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 04-October 12

Re: Flicker Problem on form loading

Posted 06 October 2012 - 08:57 PM

thanks Kevin,

I have not added Paint event in my code anywhere,
so could you elaborate what should i try exactly.
Was This Post Helpful? 0
  • +
  • -

#4 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1043
  • View blog
  • Posts: 4,057
  • Joined: 02-July 08

Re: Flicker Problem on form loading

Posted 06 October 2012 - 09:34 PM

I cannot offer a better solution using WinForms, but I highly recommend WPF. It takes a little getting used to - and yet it will amaze you! Oh and you can do everything your wanting with it. Controls with transparency is one of it's specialties. I think am pretty much done with WinForms. Don't worry we have a forum for WPF here too!
Was This Post Helpful? 1
  • +
  • -

#5 trevster344  Icon User is online

  • The Peasant
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,501
  • Joined: 16-March 11

Re: Flicker Problem on form loading

Posted 06 October 2012 - 10:33 PM

Got any tutorials for WPF Hawk? There are plenty of articles out there, but any that do a better job than the rest, that ca you can recall?
Was This Post Helpful? 0
  • +
  • -

#6 xrndMember  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 04-October 12

Re: Flicker Problem on form loading

Posted 07 October 2012 - 12:43 AM

thanks HAWK

yeah Travster344 getting proper tutorial for WPF can help a lot.
Was This Post Helpful? 0
  • +
  • -

#7 xrndMember  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 04-October 12

Re: Flicker Problem on form loading

Posted 16 October 2012 - 11:52 AM

Here are links for WPF.

http://wpftutorial.n...pfdevtools.html

http://www.codeproje...orial-Beginning

Hope it helps.
Was This Post Helpful? 0
  • +
  • -

#8 deery5000  Icon User is offline

  • D.I.C Addict

Reputation: 78
  • View blog
  • Posts: 966
  • Joined: 09-May 09

Re: Flicker Problem on form loading

Posted 20 May 2013 - 01:57 AM

I know this is an old thread, as I have been doing this in my windows forms with panels I thought id share the code :)

remove flickering
'PREVENT FLICKERING 
    Protected Overloads Overrides ReadOnly Property CreateParams() As CreateParams
        Get
            Dim cp As CreateParams = MyBase.CreateParams
            cp.ExStyle = cp.ExStyle Or 33554432
            Return cp
        End Get
    End Property
    Private Sub PreVentFlicker()
        With Me
            .SetStyle(ControlStyles.OptimizedDoubleBuffer, True)
            .SetStyle(ControlStyles.UserPaint, True)
            .SetStyle(ControlStyles.AllPaintingInWmPaint, True)
            .UpdateStyles()
        End With

    End Sub



Was This Post Helpful? 0
  • +
  • -

Page 1 of 1