Results 1 to 4 of 4

Thread: [RESOLVED] [2005] Paint Event.

  1. #1

    Thread Starter
    Fanatic Member Nove's Avatar
    Join Date
    Jul 2004
    Posts
    736

    Resolved [RESOLVED] [2005] Paint Event.

    I've got code in the _paint event of a picturebox to draw some stuff to it. However, the paint code only seems to fire when it's been drawn over (by another window and such). How can I get to paint event to fire of it's own accord through code? I've tried calling the sub and constructing a painteventargs object based off of the picture box's properties but it takes too long to load. Any help?
    Thanks.

  2. #2
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,521

    Re: [2005] Paint Event.

    VB Code:
    1. [ControlName].Invalidate
    2. 'or
    3. [ControlName].Refresh
    Visual Studio Team Edition 2005
    GDI+ Links: Bob Powell VB.Net Heaven
    API Links: All API Pinvoke.Net
    VB6 to VB.Net: Visual Basic 6 to .NET Function Equivalents (Thread)

  3. #3

    Thread Starter
    Fanatic Member Nove's Avatar
    Join Date
    Jul 2004
    Posts
    736

    Re: [2005] Paint Event.

    Thanks.

  4. #4
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: [RESOLVED] [2005] Paint Event.

    Also, to prevent flickering set these properties in the Form_Load event:
    VB Code:
    1. SetStyle(ControlStyles.OptimizedDoubleBuffer, True)
    2.         SetStyle(ControlStyles.AllPaintingInWmPaint, True)
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width