Hi,
Is it possible to set the ImageBox background color to transparent?
As with a standard .NET System.Windows.Forms.PictureBox.
Is this not supported? :(
Thanks,
Hello,
This isn't something that is currently supported, although I raised an issue on the source repository (https://github.com/cyotek/Cyotek.Windows.Forms.ImageBox) to add this in a future update.
In the meantime, you could try creating your own custom control that inherits from ImageBox and turns on the correct style, then it will automatically paint correctly (if the BackColor property is set to Transparent) as I haven't overridden default background painting.
public class MyImageBox : Cyotek.Windows.Forms.ImageBox
{
public MyImageBox()
{
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
}
}
I haven't fully tested this, but from a quick experiment changing the demonstration application it seems to work.
[attachment id=0 msg=1151]
Hope this helps.
Regards;
Richard Moss
Thanks, I'll try this.