I don't quite understand what you want to do.
As far as I can guess, you want to make the buttons be the same dimensions regardless of the resolution (i.e. to occupy the same space on the screen when resolution is 800x600 or 1280x1024) and you fear that by changing resolution, it will going to mess up the sprites dimensions (or texture rect) inside buttons.
I will assume that this is what you wanted to say.
If it wasn't, then try again with explaining your problem, preferably with some minimal code.
but each button has its own sprite and when I change the resolution I think it will break because I need all the sprites to stay the same size relative to the resolution of the window
When you set a texture rect to your sprite, it should remain the same until you explicitly demand to be changed. The texture rect of sprite also represents it's dimensions. The only other way to change dimensions without changing the texture rect is to call "scale" or "setScale" functions.
Therefore, changing resolutions shouldn't change the texture rect of a sprite.
But when you change resolutions without changing the dimensions of objects, then they will appear bigger or smaller, in regard of resolution's size.
In order to make object scale with the resolution, you need to use sf::View and keep the old view when you change resolutions.
This is the simplest aproach, do this only when you are recreating windows (usually when they are in fullscreen).
// First create a window:
sf::RenderWindow win(sf::VideoMode(1024,768)), "Bacon", sf::Style::Fullscreen);
// then make a view using the current size of the window:
sf::View view;
view.setSize(win.getSize());
win.setView(view);
// Sometime later, you recreate the window in new resolution...
win.create(sf::VideoMode(800,600)), "Bacon", sf::Style::Fullscreen);
// But now you don't reset the view size, but merely applying the old size onto the new window.
win.setView(view);
// And now the contents of the program will be resized to fit the screen.
Bear in mind that this is default behavior when you resize the window with your mouse. But you can't resize when in fullscreen: you need to recreate the window.
Hope it helps.