Home All Groups Group Topic Archive Search About

stop the painting of a form

Author
21 Jul 2006 9:52 AM
Robert Smith
Hello,
     I have a problem with a form loading a repainting. Because the form
uses an office 2000 styles, when it paints it causes a lot of flickering. The
standard advice is to set the following
  SetStyle(ControlStyles.DoubleBuffer, True)
   SetStyle(ControlStyles.AllPaintingInWmPaint, True)

However this seems to make no difference. When the form loads it originall
appears in the old grey colour of classic windows and then quickly changes to
the new blue of
Office 2000 styles. This causes a lot of flickering, any ideas to reduce or
possible remove this so that the form appears fully formed. The form is an
inherited form so this may be another issue.
Regards
Robert

Author
21 Jul 2006 11:20 AM
AMercer
>      I have a problem with a form loading a repainting. Because the form
> uses an office 2000 styles, when it paints it causes a lot of flickering. The
> standard advice is to set the following
>   SetStyle(ControlStyles.DoubleBuffer, True)
>    SetStyle(ControlStyles.AllPaintingInWmPaint, True)
>
> However this seems to make no difference. When the form loads it originall
> appears in the old grey colour of classic windows and then quickly changes to
> the new blue of
> Office 2000 styles. This causes a lot of flickering, any ideas to reduce or
> possible remove this so that the form appears fully formed. The form is an
> inherited form so this may be another issue.

If the problem is confined to the form load event, then do Me.Hide at the
top and Me.Show at the bottom of the load event handler.  This works for me
in all cases where the first draw of a form is clunky.
Author
21 Jul 2006 6:11 PM
GhostInAK
Hello AMercer,

YIKES. 


Try using LockWindowUpdate() at the beginning and end of the paint cycle.

-Boo

Show quoteHide quote
>> I have a problem with a form loading a repainting. Because the form
>> uses an office 2000 styles, when it paints it causes a lot of
>> flickering. The
>> standard advice is to set the following
>> SetStyle(ControlStyles.DoubleBuffer, True)
>> SetStyle(ControlStyles.AllPaintingInWmPaint, True)
>> However this seems to make no difference. When the form loads it
>> originall appears in the old grey colour of classic windows and then
>> quickly changes to the new blue of Office 2000 styles. This causes a
>> lot of flickering, any ideas to reduce or possible remove this so
>> that the form appears fully formed. The form is an inherited form so
>> this may be another issue.
>>
> If the problem is confined to the form load event, then do Me.Hide at
> the top and Me.Show at the bottom of the load event handler.  This
> works for me in all cases where the first draw of a form is clunky.
>