Flickering
-
Hi, Here is my code: Form_Leave() { this.Opacity = 0.5; } Form_Enter() { this.Opacity = 1; } If I have 10 controls in my form, I need to add this Form event handler to each and every controls in the form. And when I do that when Mouse_Leave and Mouse_Enter occur my form get flickering. Is there any other way to avoid flickering and adding event hander to each and every contol. Thanks in advance Muthu.
-
Hi, Here is my code: Form_Leave() { this.Opacity = 0.5; } Form_Enter() { this.Opacity = 1; } If I have 10 controls in my form, I need to add this Form event handler to each and every controls in the form. And when I do that when Mouse_Leave and Mouse_Enter occur my form get flickering. Is there any other way to avoid flickering and adding event hander to each and every contol. Thanks in advance Muthu.
Use
SuspendLayout()
, do what you have to do,ResumeLayout()
(and eventuallyRefresh()
)SkyWalker
-
Use
SuspendLayout()
, do what you have to do,ResumeLayout()
(and eventuallyRefresh()
)SkyWalker
-
Hi, Here is my code: Form_Leave() { this.Opacity = 0.5; } Form_Enter() { this.Opacity = 1; } If I have 10 controls in my form, I need to add this Form event handler to each and every controls in the form. And when I do that when Mouse_Leave and Mouse_Enter occur my form get flickering. Is there any other way to avoid flickering and adding event hander to each and every contol. Thanks in advance Muthu.
rather than handling this with an event handler in each control, do it all in the main form's event handler:
this.SuspendLayout();
foreach( Control ctl in this.Controls)
{
ctl.opacity = x;
}
this.ResumeLayout(); -
rather than handling this with an event handler in each control, do it all in the main form's event handler:
this.SuspendLayout();
foreach( Control ctl in this.Controls)
{
ctl.opacity = x;
}
this.ResumeLayout(); -
Hi, Here is my code: Form_Leave() { this.Opacity = 0.5; } Form_Enter() { this.Opacity = 1; } If I have 10 controls in my form, I need to add this Form event handler to each and every controls in the form. And when I do that when Mouse_Leave and Mouse_Enter occur my form get flickering. Is there any other way to avoid flickering and adding event hander to each and every contol. Thanks in advance Muthu.
Controls don't have Opacity properties. It applies to the Form, not it's controls. The entire form has to change its opacity, not the controls.
Dave Kreskowiak Microsoft MVP - Visual Basic