I created a VB.NET Add-In tool that adds layers to the map, from a Layer List ComboBox. Everything works fine, but I do not want the tool to work when in Layout View. I know how to verify if I'm in the Layout View and display a message, but I would like to disable the ComboBo, instead of a message box. How can I modify my code to accomplish this?
If TypeOf My.ArcMap.Document.ActiveView Is IPageLayout Then
MsgBox("Switch to Data View to run the tool")
Return
End If