I hope the following version is what you want.
You can select either "Fix k, change dx" mode or "Fix dx, change k" mode.
For Fix k, change dx mode:
You can drag dx slider when the simulation is paused.
For Fix dx, change k mode:
You can change dx only by dragging block.
You can click "init" to change the displacement of spring to previous value.
The block will move to different heights up the ramp with different spring constant.
I also add numerical value for kinetic energy, potential energy, etc.