Try out the WM_ERASEBKGND

Hi,

I have made a form called StickyNotes that keeps on flickering after resizing it.
So I try a lots of diffirent code that I have found on the internet to prevent this.

Now I want to try the WM_ERASEBKGND, but i get an error:

"The name 'Win32API' does not exist in the current context"

What do I have to declare to make this methode work?

Peter

protected override void WndProc(ref Message m)
        {

            if (m.Msg == Win32API.WM_ERASEBKGND)
            {

                m.Result = new IntPtr(0);

                return;

            }

            base.WndProc(ref m);

        }

Open in new window

LVL 1
peterkiersAsked:
Who is Participating?
 
AndyAinscowFreelance programmer / ConsultantCommented:
First.  Your original question - I guess you have not copied everything they do in the example code, which is why you have this error.

Second.  I suggested in an earlier question: why not have a border on the form rather than trying to do your own border (which seems to have been ongoing over some weeks and still not working).
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_CSharp/Q_27325960.html

There you accepted an answer to this problem of flickering - or did the accepted comments not work?
0
 
peterkiersAuthor Commented:
Yes, it did for that problem, I had draw a borderline around the form.
But I haven't draw a border anymore.

Peter
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
AndyAinscowFreelance programmer / ConsultantCommented:
Are you doing anything special (eg. Invalidate, Paint) - I have a form (with a number of controls on it) that I resize rapidly with the mouse - not a hint of flickering that I see.
0
 
peterkiersAuthor Commented:
I have a borderless form with a devexpress component on it called GroupControl.
Its just like a standard panel but then with a diffirent appearance. The GroupControl
has a border. So I have it set to dock is fill. But when I resize the form, the borderline
of the groupcontrol flikkers.

Peter
0
 
peterkiersAuthor Commented:
AndyAinscow, your right.

Greetings,

Peter Kiers
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.