Flickering form problem
-
Hi I have created a graphically heavy windows forms application and when I minimize this application to system tray and bring it back, the form flickers for two seconds. Form contains over 5 transparent PNG images. I am using this code to minimize to tray:
this.WindowState = FormWindowState.Minimized;
this.ShowInTaskbar = false;
TrayIcon.Visible = true;
TrayIcon.ShowBalloonTip(2500, "GameSec hala çalışıyor!", "GameSec hala çalışmaktadır, tekrar görünür hale getirmek için tıklayın.", ToolTipIcon.Info);and this code to show it back:
this.WindowState = FormWindowState.Normal;
this.ShowInTaskbar = true;
TrayIcon.Visible = false;I am aware that Hide() and Show() can be used in normal situations but it doesnt work for me because this form I am talking about is owned by another form. Here is a video that I've created for you to see the problem by yourself: http://www.youtube.com/watch?v=224IrASTu8E[^] Thanks in advance.
-
Hi I have created a graphically heavy windows forms application and when I minimize this application to system tray and bring it back, the form flickers for two seconds. Form contains over 5 transparent PNG images. I am using this code to minimize to tray:
this.WindowState = FormWindowState.Minimized;
this.ShowInTaskbar = false;
TrayIcon.Visible = true;
TrayIcon.ShowBalloonTip(2500, "GameSec hala çalışıyor!", "GameSec hala çalışmaktadır, tekrar görünür hale getirmek için tıklayın.", ToolTipIcon.Info);and this code to show it back:
this.WindowState = FormWindowState.Normal;
this.ShowInTaskbar = true;
TrayIcon.Visible = false;I am aware that Hide() and Show() can be used in normal situations but it doesnt work for me because this form I am talking about is owned by another form. Here is a video that I've created for you to see the problem by yourself: http://www.youtube.com/watch?v=224IrASTu8E[^] Thanks in advance.
This article Flicker free drawing using GDI+ and C#[^] has some hints. Also if you are drawing on to panels, you can sub-class the standard panel, and just add the following to the constructor.
SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer, true);
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
Hi I have created a graphically heavy windows forms application and when I minimize this application to system tray and bring it back, the form flickers for two seconds. Form contains over 5 transparent PNG images. I am using this code to minimize to tray:
this.WindowState = FormWindowState.Minimized;
this.ShowInTaskbar = false;
TrayIcon.Visible = true;
TrayIcon.ShowBalloonTip(2500, "GameSec hala çalışıyor!", "GameSec hala çalışmaktadır, tekrar görünür hale getirmek için tıklayın.", ToolTipIcon.Info);and this code to show it back:
this.WindowState = FormWindowState.Normal;
this.ShowInTaskbar = true;
TrayIcon.Visible = false;I am aware that Hide() and Show() can be used in normal situations but it doesnt work for me because this form I am talking about is owned by another form. Here is a video that I've created for you to see the problem by yourself: http://www.youtube.com/watch?v=224IrASTu8E[^] Thanks in advance.
I think thats normal 'coz GDI+ is slow. BTW did you notice something, when the form was flickring a magenta type color shown, I think you should change that color to gray or something similar to that form.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN% R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
----------------------------------------------- 128 bit encrypted signature, crack if you can
-
I think thats normal 'coz GDI+ is slow. BTW did you notice something, when the form was flickring a magenta type color shown, I think you should change that color to gray or something similar to that form.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN% R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
----------------------------------------------- 128 bit encrypted signature, crack if you can
Thank you both for helping. I've solved the magenta-ish color problem but it's still flickering.