SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    May 2003
    Location
    NY, USA
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Sub menu items with tick marks

    Hi everyone,

    I have this function the works in identifying the state of menu item on a menu bar, however I have tick marks next to these menu items depending on the state of the items at certain times. I cannot get my script to recognize these tick marks when there are displayed. Any help would be much appreciated......here is my function below.

    Option Explicit

    Sub Main()
    On Error Resume Next

    Dim oe As TOnError
    Set oe = OnError("ErrorFunction")

    Dim wind As TWindow
    Dim mymenu, mymenu2 As TMenu
    Dim myitem, myitem1 As TMenuItem
    Dim I, k, x As Integer

    x = 5 'Modify the numeric value to represent the menubar item

    '************************************************* ***************
    ' Depending on the application you are testing on, modify the
    ' next 2 statements to reflect your test application.
    '************************************************* ***************
    Window("Window").Attach
    Set wind = Window("Window")
    '************************************************* ***************

    Set mymenu = wind.GetMenu(tpMenu)
    Set mymenu2 = mymenu.GetPopupMenu(x)
    Set myitem1 = mymenu.GetItem(x)

    If myitem1.Enabled = True Then
    TestLog.Comment ("***MenuItem " & myitem1.Text & " This menu item is enabled.")
    For I = 0 To mymenu2.Count - 1
    k = k + 1
    Set myitem = mymenu2.GetItem(k)

    If myitem.Enabled = True Then
    TestLog.Comment ("***MenuItem " & myitem1.Text & ": Sub-position " & CStr(myitem.Position) _
    & ": item " & myitem.Text & " is enabled.")
    Else
    TestLog.Comment ("***MenuItem " & myitem1.Text & ": Sub-position " & CStr(myitem.Position) _
    & ": item " & myitem.Text & " is disabled.")
    End If
    Next
    Else
    TestLog.Comment ("***MenuItem " & myitem1.Text & " This menu item is disabled.")
    End If

    End Sub

  2. #2
    Senior Member
    Join Date
    Nov 2002
    Location
    Lausanne, Switzerland
    Posts
    558
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Sub menu items with tick marks

    If myitem.Checked = True Then
    TestLog.Comment ("***MenuItem " & myitem1.Text & ": Sub-position " & CStr(myitem.Position) _
    & ": item " & myitem.Text & " is checked.")
    End If

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.11%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 01:12 PM.

Copyright BetaSoft Inc.