If Typeof wc Is winform.PictureViewer MessageBox.show(wc.Name) Dim pv As winform.pictureviewer = wc pv.AddCommand.enabled = False pv.OpenCommand.Enabled= False pv.DeleteCommand.Enabled= False pv.ClearCommand.Enabled= False pv.SaveAsCommand.Enabled= False End If