Ranorex

How would keep a context menu from disappearing?

 
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexNet
View previous topic :: View next topic  
Author Message
chall



Joined: 20 Aug 2007
Posts: 15

PostPosted: Thu Sep 06, 2007 5:05 pm    Post subject: How would keep a context menu from disappearing?
I am trying to make a menu selection using the following code:

Ranorex.Menu menu = new Ranorex.Menu(form);

string[] menuItems = itemName.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

int numOfMenuItems = menuItems.Length;
for (int i=0; i<numOfMenuItems; i++) {
if (i==0) {
menu.SelectItemText(menuItems[i]);
}
else {
Ranorex.ContextMenu.SelectItemText(menuItems[i]);
}
}

Sometimes, the code works fine and each menu option is selected; then there are times when the context menu disappears and the last option is not selected. It appears the path of the mouse movement is causing the context menu to disappear; and I don't know how to prevent that from happening.

Do you have any ideas?
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 05 Jul 2006
Posts: 351

PostPosted: Thu Sep 06, 2007 5:46 pm    Post subject:
Please try the the following:

Code: click into code to enlarge
ContextMenu.SelectItemText("ContextMenuSubmenu1", "SubSubMenu1", "SubSubItem1");


See also the sample "RanorexVS2005Sample3.exe" in the Samples directory.

Jenö
Ranorex Team
Back to top
View user's profile Send private message Visit poster's website
chall



Joined: 20 Aug 2007
Posts: 15

PostPosted: Thu Sep 06, 2007 6:08 pm    Post subject:
That did it, thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexNet All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum