| View previous topic :: View next topic |
| Author |
Message |
chall
Joined: 20 Aug 2007 Posts: 15
|
Posted: 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 |
|
 |
admin Site Admin
Joined: 05 Jul 2006 Posts: 351
|
Posted: 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 |
|
 |
chall
Joined: 20 Aug 2007 Posts: 15
|
Posted: Thu Sep 06, 2007 6:08 pm Post subject: |
|
| That did it, thanks! |
|
| Back to top |
|
 |
|