Just make the object of the Custom button and specify the property as and when needed.