Enabling and disabling buttons

is there a code that when you click on a button it enables or disables another button?