I think that instead of changing the max value, you should recalculate accordingly how much the slider is supposed to move. What are you using the slider for? Maybe I can think of a workaround.
You might also consider using a canvas instead of a slider. If you try, you will definitely make a nicer slider than the original one...