Whenever you need this kind of info, look up get functions in FileMaker help.
In this case, Get(LayoutViewState) provides the info you need.
You could use this with two conditional formats for two different blocks of layout text grouped with your button to set the text size of one text block to an extremely large size to make one of the two blocks disappear.
For the "Table View" block, use Get(LayoutViewState) = 2 to specify a large text size and hide it.
For the "Form View" block use Get(LayoutViewState) = 0 to specify a large text size and hide it.
You can also an unstored text calculation field for this:
If ( Get(LayoutViewState) = 0 ; "Table View" ; "Form View" )
You can group this field with your button to make it's lable change when the view changes.
Thank you very much!