topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday April 19, 2024, 8:03 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Flicker with transparent labels on different panels  (Read 3583 times)

sukhjinder

  • Participant
  • Joined in 2007
  • *
  • Posts: 13
    • View Profile
    • Donate to Member
Flicker with transparent labels on different panels
« on: May 08, 2008, 11:52 AM »
I have a Form with a Panel mainBackPanel. To mainBackPanel I add different panels say redPanel, greenPanel, bluePanel depending on key pressed, r, g, b respectively. Each panel has a different image (say tomatoes, trees, sky) and a transparent label.

Now when the panel changes, I see a small flicker on the area covered by the label.

mainBackPanel (to which the individual panels are added) is double buffered.

All KeyEvents are being handled by MainForm in the following method

void mainFormKeyUpHandler(Object o, KeyEventArgs kev)
{   
   if( kev.KeyCode == Keys.R )
   {
         this.mainBackPanel.Controls.Clear();
         this.mainBackPanel.SuspendLayout();
         this.mainBackPanel.Controls.Add(this.mainFormPanel);                               this.mainBackPanel.ResumeLayout();   
   }   
   else
   .
   .
   .
}


The code, in .NET 2.0, can be found here.

You will need to put 3 image files namely fb.jpg, mf.jpg and pl.jpg in bin/debug folder prior to running the app.

Please suggest how to get rid of the flicker.

Thanks
Sukhjinder