This is using UiPath.Form.Activities v24x.
When building your form, put everything inside one table (1 column, 1 row).
For the button, fill in the Event property:
For the table go to the Logic tab and add the following logic:
Make sure the button’s Event property and the logic’s event listener are typed exactly the same.
Now when you click the button, the entire table is disabled.