Hello !
i have a user-control designed as a button . The problem is that i can't display an image as the background.
public partial class inout_buton : UserControl
{
Bitmap bmp;
public inout_buton()
{
InitializeComponent();
try
{
Stream s = this.GetType().Assembly.GetManifestResourceStream("Network_Remote_Monitoring.but_verde.png");
bmp = new Bitmap(s);
s.Close();
}
catch
{
MessageBox.Show("it's bad");
}
this.BackgroundImage = bmp;
}
}
In this example, Network_Remote_Monitoring is my namespaceand but_verde.png is my desired background. The pop-up MessageBox always appears => not executing the try statements.
Can you find the problem?