It doesn't matter anymore. It was a stupid homework which I finished from 4 to 5 am in the morning before the deadline
I had something like:Image buttonPlayDisabled;If I don't change the image on EnabledChanged event, by default, a desaturated version of the image already on my button is put in place. And it looks kind of ugly. Is there a way to disable this behavior ? I don't really care so much now, but just out
of curiosity
bool loaded=true;
...
Assembly assembly = Assembly.GetExecutingAssembly();
Stream stream = assembly.GetManifestResourceStream("MyProject.bitmaps.buttonPlayDisabled.jpg");
if (stream != null)
{
buttonPlayDisabled = Image.FromStream(stream);
}
stream.Close();
if(buttonPlayDisabled == null)
loaded=false;
...
private void playButton_EnabledChanged(object sender, EventArgs e)
{
if (!loaded)
return;
if (playButton.Enabled)
{
playButton.Image = buttonPlayOriginal;
}
else
{
playButton.Image = buttonPlayDisabled;
}
}