Remove Image for button
I have set a backgroundimage to a button and wonder how it would be possible to remove this image programatically.
I have tried to search all members but cant find any clue to how to do it.
button1->BackgroundImage = Image::FromFile("C:\\picture.JPG");
This is Visual C++ with Windows Form?
Well, try this. Save the initial value of BackgroundImage. Then restore it. My guess is that it would be NULL or something like that. But in any case that should work.
Yes that can be a good idéa, I beleive I also found a different solution to the problem where I could insert different images also.
Form1::BackgroundImage = Image::FromFile("C:\\pic.JPG");
>> Save the initial value of BackgroundImage
Actually when experimenting around I might need to save the initial value of BackgroundImage.
The problem is that I haven´t done this before so I am not really sure of how to do. ?
Setting it to NULL, should that be like this. If I do that my compiler says:
cannot convert parameter 1 from 'int' to 'System:: Drawing::Image ^'
button5->BackgroundImage = NULL;