You should take a look at "pan_setbmap"
Here: http://manual.conitec.net/pan_setbmap.htm

The idea:
Set the buttons which should be invisible to a completly black bitmap.
This way they are "hidden", of course you might need to add an if statement to the function of the button to check if it is visible (=> proceed) or not.