How would keep a context menu from disappearing?
Posted: Thu Sep 06, 2007 4:05 pm
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);
}
else {
Ranorex.ContextMenu.SelectItemText(menuItems);
}
}
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?
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);
}
else {
Ranorex.ContextMenu.SelectItemText(menuItems);
}
}
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?