Hi,
In the ROBOTC help file under "Joystick Control > Using Joysticks" there is a page that lists all of the buttons and functions related to them.
For the "D-Pad" it is
This returns a value from -1 to 7 where -1 means no buttons are pressed, 0 is the top button, and 7 is the upper left button (it starts at the top and counts clockwise from there).
So it looks something like this:
(I'm using the code format just to get the spacing even)
Here is the sample from the help file:
I hope that helps!