• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 471
  • Last Modified:

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

0
peterkiers
Asked:
peterkiers
  • 3
  • 3
1 Solution
 
AndyAinscowCommented:
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
 
AndyAinscowCommented:
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
Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

 
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
 
AndyAinscowCommented:
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
 
peterkiersAuthor Commented:
AndyAinscow, your right.

Greetings,

Peter Kiers
0

Featured Post

Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now