2
Contributors
5
Replies
6
Views
8 Years
Discussion Span
Last Post by dilake
0
private void button2_Click(object sender, EventArgs e)
    {
      this.button2.BackgroundImage = Image.FromFile(@"C:\picture.bmp");
    }
0

This is fine.But is there any way to store the bitmap in Resources of the project itself as we do in vc++.

0

Now i got how to include bitmap into the resources but how do i attach this particular bitmap which i created in the resources to the Button?.(I do not want to give any filepath)

0

Under your "Properties" folder in the solution explorer you will see a file called "Resources.resx". Double click on it. Then in that window click on "Add File -- Existing File" and select your image and it will embed it.

To access that image from code use Properties.Resources.<FileName>

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.