Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. DoubleBuffer in Window Form Controls...

DoubleBuffer in Window Form Controls...

Scheduled Pinned Locked Moved C#
helpcomquestion
10 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Joshua Guy
    wrote on last edited by
    #1

    I have create a custom Windows form control and enabled the built in double buffering with: this.SetStyle(ControlStyles.DoubleBuffer & ControlStyles.UserPaint & ControlStyles.AllPaintingInWmPaint, true); but this does not help my flicker problem at all... From what I have read that will work in controls, Right?.?. Joshua Guy


    Sonork ID: 100.9944 ICQ: 519642 Hotmail: JoshuaJGuy@hotmail.com

    N J 2 Replies Last reply
    0
    • J Joshua Guy

      I have create a custom Windows form control and enabled the built in double buffering with: this.SetStyle(ControlStyles.DoubleBuffer & ControlStyles.UserPaint & ControlStyles.AllPaintingInWmPaint, true); but this does not help my flicker problem at all... From what I have read that will work in controls, Right?.?. Joshua Guy


      Sonork ID: 100.9944 ICQ: 519642 Hotmail: JoshuaJGuy@hotmail.com

      N Offline
      N Offline
      Neil Van Note
      wrote on last edited by
      #2

      this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);

      J 1 Reply Last reply
      0
      • N Neil Van Note

        this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);

        J Offline
        J Offline
        Joshua Guy
        wrote on last edited by
        #3

        DOH! Well that was part of my problems, but even with that it still flickers like crazy. I have that enabled in my Windows Form control and the parent form. Any other suggestions? Joshua Guy


        Sonork ID: 100.9944 ICQ: 519642 Hotmail: JoshuaJGuy@hotmail.com

        1 Reply Last reply
        0
        • J Joshua Guy

          I have create a custom Windows form control and enabled the built in double buffering with: this.SetStyle(ControlStyles.DoubleBuffer & ControlStyles.UserPaint & ControlStyles.AllPaintingInWmPaint, true); but this does not help my flicker problem at all... From what I have read that will work in controls, Right?.?. Joshua Guy


          Sonork ID: 100.9944 ICQ: 519642 Hotmail: JoshuaJGuy@hotmail.com

          J Offline
          J Offline
          James T Johnson
          wrote on last edited by
          #4

          Are you doing all your drawing during the Paint event? Thats the only time that the double-buffering is actually used. James Simplicity Rules!

          J 2 Replies Last reply
          0
          • J James T Johnson

            Are you doing all your drawing during the Paint event? Thats the only time that the double-buffering is actually used. James Simplicity Rules!

            J Offline
            J Offline
            Joshua Guy
            wrote on last edited by
            #5

            It's all in the Paint event. To make things worse. I copied and pasted all my code into a form and it works like a charm. I'll dig in more into the control but something isn't right with that. Joshua Guy


            Sonork ID: 100.9944 ICQ: 519642 Hotmail: JoshuaJGuy@hotmail.com

            1 Reply Last reply
            0
            • J James T Johnson

              Are you doing all your drawing during the Paint event? Thats the only time that the double-buffering is actually used. James Simplicity Rules!

              J Offline
              J Offline
              Joshua Guy
              wrote on last edited by
              #6

              DOH! It was so stupid I won't even admit what I did. Joshua Guy


              Sonork ID: 100.9944 ICQ: 519642 Hotmail: JoshuaJGuy@hotmail.com

              J 1 Reply Last reply
              0
              • J Joshua Guy

                DOH! It was so stupid I won't even admit what I did. Joshua Guy


                Sonork ID: 100.9944 ICQ: 519642 Hotmail: JoshuaJGuy@hotmail.com

                J Offline
                J Offline
                James T Johnson
                wrote on last edited by
                #7

                :-D But you must tell us, if not for us do it for the children; think of the children who may fall into the same trap you did. ;P James Simplicity Rules!

                J 1 Reply Last reply
                0
                • J James T Johnson

                  :-D But you must tell us, if not for us do it for the children; think of the children who may fall into the same trap you did. ;P James Simplicity Rules!

                  J Offline
                  J Offline
                  Joshua Guy
                  wrote on last edited by
                  #8

                  If you must know. I posted the message with the following code: this.SetStyle(ControlStyles.DoubleBuffer & ControlStyles.UserPaint & ControlStyles.AllPaintingInWmPaint, true); Which of course would not enable the double buffering. Neil points out my stupid mistake(which I originally had in my other test form, but a monkey came along and changed all the |'s to &'s as a nasty joke, so as you see this was clearly the monkeys fault not mine) this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true); So I see Neil'd observation and hit myself. Well evidently I hit my self so hard that when I went to change it I went into the source of my dummy app in which I was testing the control. So the parent form was double buffered correctly. Thinking that I had enabled it in my control I was sad. So I left it alone until now. And after a break and looking in my code again I relize that the monkeys &'s had not be changed to |'s... If it weren't for the monkey I would have been set. Joshua Guy


                  Sonork ID: 100.9944 ICQ: 519642 Hotmail: JoshuaJGuy@hotmail.com

                  J N 2 Replies Last reply
                  0
                  • J Joshua Guy

                    If you must know. I posted the message with the following code: this.SetStyle(ControlStyles.DoubleBuffer & ControlStyles.UserPaint & ControlStyles.AllPaintingInWmPaint, true); Which of course would not enable the double buffering. Neil points out my stupid mistake(which I originally had in my other test form, but a monkey came along and changed all the |'s to &'s as a nasty joke, so as you see this was clearly the monkeys fault not mine) this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true); So I see Neil'd observation and hit myself. Well evidently I hit my self so hard that when I went to change it I went into the source of my dummy app in which I was testing the control. So the parent form was double buffered correctly. Thinking that I had enabled it in my control I was sad. So I left it alone until now. And after a break and looking in my code again I relize that the monkeys &'s had not be changed to |'s... If it weren't for the monkey I would have been set. Joshua Guy


                    Sonork ID: 100.9944 ICQ: 519642 Hotmail: JoshuaJGuy@hotmail.com

                    J Offline
                    J Offline
                    James T Johnson
                    wrote on last edited by
                    #9

                    Damned dirty monkeys ;P James Simplicity Rules!

                    1 Reply Last reply
                    0
                    • J Joshua Guy

                      If you must know. I posted the message with the following code: this.SetStyle(ControlStyles.DoubleBuffer & ControlStyles.UserPaint & ControlStyles.AllPaintingInWmPaint, true); Which of course would not enable the double buffering. Neil points out my stupid mistake(which I originally had in my other test form, but a monkey came along and changed all the |'s to &'s as a nasty joke, so as you see this was clearly the monkeys fault not mine) this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true); So I see Neil'd observation and hit myself. Well evidently I hit my self so hard that when I went to change it I went into the source of my dummy app in which I was testing the control. So the parent form was double buffered correctly. Thinking that I had enabled it in my control I was sad. So I left it alone until now. And after a break and looking in my code again I relize that the monkeys &'s had not be changed to |'s... If it weren't for the monkey I would have been set. Joshua Guy


                      Sonork ID: 100.9944 ICQ: 519642 Hotmail: JoshuaJGuy@hotmail.com

                      N Offline
                      N Offline
                      Neil Van Note
                      wrote on last edited by
                      #10

                      LOL, I hate it when I do that... :cool: , Errr, The monkeys I mean...

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups