Results 1 to 4 of 4

Thread: Using DrawEdge in a UserControl

  1. #1

    Thread Starter
    Addicted Member VB6Coder's Avatar
    Join Date
    Apr 2001
    Location
    Northampton, UK
    Posts
    185

    Question Using DrawEdge in a UserControl

    I've created a usercontrol that acts as a container, and draws a border using the DrawEdge API (to give that sunken Panel effect).

    The only problem is that, in the Paint event I have to call UserControl.cls to make sure the DrawEdge is displayed correctly. This make the border flicker.

    I've tried using the LockWindowUpdate to stop the flicker, but because it is a container, the LockWindowUpdate effects the drawing of the controls inside it.

    Has anyone got any ideas how I can stop the flicker?



    Cheers

  2. #2
    Dreamlax
    Guest
    I had a case of this, but when I looked through the code I realised that 'UserControl.Refresh' were executed twice (because I had the Resize Sub point to another sub, which had UserControl.Refresh in it), and this caused the flicker. I took the first one out andno flicker.

  3. #3
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    If you set the AutoRedraw property to True and then refresh then control after all your drawings are done it shouldn't flicker.

  4. #4

    Thread Starter
    Addicted Member VB6Coder's Avatar
    Join Date
    Apr 2001
    Location
    Northampton, UK
    Posts
    185
    Cheers Dreamlax and Rick.

    I'll give your suggestions ago.


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