How can I change the image on the picture box when the mouse is over the picture box I know how to end the application when the mouse is over the picture box but what is the code for changing the picture C++ (I need to use mouse enter class)
Your wrong because i know it's possible i have done it before it was easy i dont know if its my question but what i need is picture box is going to load a diffrent image when the mouse over and when the mouse is not over it's going to go back to the image before and it should be easy the picture all in one location!
Through what method have you placed the image in the picturebox? Show the code that you use to initialize it. I have found it is easiest to set the image as "BackgroundImage" of the picturebox and then change it by replacing that BackgroundImage with a new one.
Well, it certainly requires code to change the picture. Did you put the picture in through the properties window on the right side of the IDE?
I think you're misinterpreting background image here. I'm not talking about the Windows background, I'm talking about the image that is displayed in the picture box. I've never had any luck using the PictureBox.Image in this fashion, that's why I'm recommending setting and changing the backgroundimage of the picturebox, not whatever you have for the background of your application or the Windows background.
If you have set the image as a PictureBox Image using the properties window, you just change the image in your MouseEnter handler. You'll need a MouseLeave handler setting the picture back to what it was if you want that effect.
In the MouseEnter: yourPictureBoxNameHere->Image = Image::FromFile(YourNewImagePathString); In the MouseLeave: yourPictureBoxNameHere->Image = Image::FromFile(YourOriginalImagePathString); I'm not sure what the big deal was, you were 3/4 of the way there. I was suggesting you use the BackgroundImage property (which can be set in the Properties window just like the Image property can) because there's more control over how the image is placed. I did it your way with the Image and the picturebox came out scaled funny (I'm sure there's a way to change this with Image, but I was offering you a suggestion I was familiar with).