How to change the margin of a component in code