I'm having some dicciculties with my drop down menus right now. I'm currently working in a .Net application but have only worked in Java apps previously, and never had this problem.
The problem is that I can't seem to read the text of my drop down submenu items. I can click on items no problem, just can't seem to get the text.
Here's where I am:
<font class="small">Code:</font><hr /><pre>mainMenu = WinFormsObject("ToolStripPanel", "", 4).WinformsObject("m_mainmenu")
mainMenu.Items.Count 'returns 6'
mainMenu.wButtonText(3) 'Returns &Capture<-- This is from the main menu, though, not the submenu
mainMenu.wDropDownMenu("&Capture").click("Star t Multiple Frame") '<-- This works and changes the submenu item to 'Stop Multiple Frame'</pre><hr />
From above, in the last example, I click on a menu item and it changes to a different text (so it will change from Start.. to Stop...) Can I read this from the submenu? What I'd like to do is something like:
<font class="small">Code:</font><hr /><pre>
If subMenuItem <> "Stop..." then
Here's a sample function that logs all subitems of the needed item. Does this help?
<font class="small">Code:</font><hr /><pre>Sub LogDropDownItems(toolStripItems, itemText)
Dim item, i
For i = 0 To toolStripItems.Count - 1
Set item = toolStripItems.Item(i)
If (itemText = "") OR (item.Text.OleValue = itemText) Then
If item.HasDropDownItems Then Call LogDropDownItems(item.DropDownItems, "")
Set toolStrip = ' Obtain the tool strip