One way could be:
Create a number of sprites - one with each image - and store them all in a
vector:
std::vector<sf::Sprite> sprites;
Store which of your images you wish to be displayed in a variable:
unsigned int currentSprite{ 0 };
Change
currentSprite to the number of the image that you want to display whenever that button is pressed (it is assumed here that the buttons are mouse buttons and that you test them using events):
if (event.type == sf::Event::MouseButtonPressed)
{
if (event.mouseButton.button == sf::Mouse::Left)
currentSprite = 2;
else if (event.mouseButton.button == sf::Mouse::Right)
currentSprite = 1;
else if (event.mouseButton.button == sf::Mouse::Middle)
currentSprite = 0;
}
Only draw the one sprite necessary:
window.draw(sprites[currentSprite]);
Remember to do the rest of the work! e.g. clear and display the window, do the event loop, load the textures and create the sprites, ensure that
currentSprite is never out-of-range, etc..