Function controlling the selected frame's size