It is not possible to add or remove a button at runtime, but you can hide or show a tab or group at runtime using Application Modes and which you can set any button texts and images at runtime.
Thus, you can declare and use multi-purpose buttons that will be displayed only at a given specific application mode and contain certain texts and images defined at run time.
source
share