Forum Discussion

prasant87's avatar
prasant87
New Contributor
14 years ago

How to Close a Tabbed Form - mnuClose_Click

I am working on a windows application having Tabbed Forms. I want to close any selected tab using Test Complete.

As far as I have explored, I found a Method called  "mnuClose_Click" in Object Spy Method section.



But I do not know how to use this method. Can somebody please help me?



Below codes I have tried but does not work-



1. Sys.Process("XXXX").WinFormsObject("MainForm").WinFormsObject("_workAreaTab").SelectedTab.mnuClose_Click



2.

Set Obj=Sys.Process("XXXX").WinFormsObject("MainForm").WinFormsObject("_workAreaTab").SelectedTab

Call Obj.mnuClose_Click 'Does not work



3. 



Set Obj=Sys.Process("XXXX").WinFormsObject("MainForm").WinFormsObject("_workAreaTab").SelectedTab

Call mnuClose_Click(Obj)   'Does not work

1 Reply

  • Hi,



    This method is most probably related to the appropriate event which occurs when the tab gets a command to close. If you want to call it, you should pass a parameter to it whose type you can find out by focusing on this method and looking at its description.



    If you just want to close the tab, call the Click method with coordinates of its close button.