0

I am currently trying to make a fading transition when changing the background image of a tab during a ComboBox SelectedIndexChanged event. However, I couldn't find the opacity properties in a tab's background image. Any advice for me how to do this?

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
    if (comboBox1.SelectedIndex == 1)
    {
        // Some opacity value changing at here
        string pathDesktop = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
        string imagePath1 = pathDesktop + "\\App Background\\";
        tabPage1.BackgroundImage = Image.FromFile(imagePath1 + "saadsda.jpg");
    }
}
Grant Winney
  • 65,241
  • 13
  • 115
  • 165
fj123
  • 963
  • 1
  • 8
  • 11
  • 1
    Opacity is only supported on top-level windows, not client windows. That's changing, Windows 8 supports client window opacity, but that's future-music for .NET and probably a lot of your customers. Fading an image isn't difficult in Winforms, doing so while you are switching tabs ought to be tricky however. – Hans Passant Jun 18 '13 at 15:56
  • possible duplicate of [Fade a panel- Windows forms](http://stackoverflow.com/questions/10178559/fade-a-panel-windows-forms) – Hans Passant Jun 18 '13 at 15:56

1 Answers1

-1

Like HighCore said in his comment animations are not supported in windows forms applications. But if it is solely the functionality you are looking for then you can set the object to hidden Object.Visible=false;

lamilambkin
  • 117
  • 1
  • 1
  • 9