c# - How to force window to redraw? -


i have full-screen window, using code:

windowstyle = system.windows.windowstyle.none; windowstate = system.windows.windowstate.maximized; topmost = true; 

it works ok under win7, under winxp window elements don't redrawn when window goes fullscreen. there way force window make full redraw , layout update?

upd redrawn ok, if switch app atl-tab , mine

you force window repaint using windows api.

example class implementation:

public static class windowsapi {     private const int wmpaint = 0x000f;      [dllimport("user32.dll")]     public static extern int64 sendmessage(intptr hwnd, uint msg, intptr wparam, intptr lparam);      public static void forcepaint(this form form)     {         sendmessage(form.handle, wmpaint, intptr.zero, intptr.zero);     } } 

usage:

form testform = new form(); testform.forcepaint(); 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -