Hi serge,
You can do something like this:
[DllImport("user32.dll")]
public static extern bool InvalidateRect(IntPtr hwnd,IntPtr lpRect,bool
bErase);
private void button1_Click(object sender, System.EventArgs e)
{
InvalidateRect(IntPtr.Zero ,IntPtr.Zero ,true);
}
Hope this helps
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
| From: "serge anton" <
[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| Subject: refresh the screen
| Date: Fri, 12 Sep 2003 23:40:55 +0200
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Lines: 21
| Message-ID: <
[email protected]>
| Organization: Noos
| NNTP-Posting-Date: 12 Sep 2003 21:40:57 GMT
| NNTP-Posting-Host: 81.64.121.30
| X-Trace: 1063402857 news.noos.fr 7514 81.64.121.30
| X-Complaints-To: (e-mail address removed)
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onlin
e.de!newsfeed.icl.net!newsfeed.fjserv.net!news.tele.dk!news.tele.dk!small.ne
ws.tele.dk!oleane.net!oleane!teaser.fr!noos.fr!not-for-mail
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:184541
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi,
|
| I want to refresh all the screen (including the desktop) or a part of the
| screen.
| I can have a reference to the screen with win32 API :
|
| [DllImport("user32")]
| public static extern int GetWindowDC(IntPtr hwnd);
|
| private void fct(){
| Graphics g = Graphics.FromHdc(new IntPtr(GetWindowDC(IntPtr.Zero)));
| }
|
| But I don't know how to refresh the screen or a part of the screen
|
| Thanks to help me
|
| Serge
|
|
|
|