Jump to content

Recommended Posts

Posted

Howdy all,

I'm stumped.

The script I'm writing is trying to process all the items in a list box.

I found a way to determine the total number of entries in the list box; however,

it would be nice to be able to capture the actual text for each entry in the listbox.

As far as I can tell none of the CommandControl functions will pull the text of the highlighted item. Neither does any "copy to clipboard" function or keystroke.

I will have no knowledge in advance of what entries will be in the list.

I was kind of hoping using the code below would get the currently highlighted item - but it doesn't.

$var = Controlcommand("Open Report", "", "ListBox1", "FindString", "")

MsgBox(0, "Text read was:", $var)

Suggestions ?

TIA

ponzi

Posted

Read closer:

"GetCurrentSelection", "" Returns name of the currently selected item in a ListBox or ComboBox

Posted

Ok - I read closer and ......

IsVisible, "" (Returns 1 if Control is visible)

IsEnabled, "" (Returns 1 if Control is enabled)

ShowDropDown, "" (drops a ComboBox)

HideDropDown, "" (UNdrops a ComboBox)

AddString, "string" (adds a string to the end in a ListBox or ComboBox)

DelString, occurrence (deletes a string according to occurence in a ListBox or ComboBox)

FindString, "string" (returns occurence ref of the exact string in a ListBox or ComboBox)

SetCurrentSelection, occurrence (sets selection to occurrence ref in a ListBox or ComboBox)

SelectString, "string" (sets selection according to string in a ListBox or ComboBox)

IsChecked, "" (returns 1 if Button is checked)

Check, "" (Checks radio or check Button)

UnCheck, "" (Unchecks radio or rheck Button)

GetLineCount, "" (Returns # of lines in an Edit)

GetCurrentLine, "" (Returns the line # where the caret is of an Edit)

GetLine, line# (Returns text at line # passed of an Edit)

GetSelected, "" (Returns selected text of an Edit)

EditPaste, "string" (Pastes the 'string' at the Edit's caret position)

CurrentTab, "" (Returns the current Tab shown of a SysTabControl32)

TabRight, "" (Moves to the next tab to the right of a SysTabControl32)

TabLeft, "" (Moves to the next tab to the left of a SysTabControl32)

Where in this list from the help file is "GetCurrentSelection" ??

Thanks for your suggestion - it did work

ponzi

Posted

Apparently it is missing from the (older) documentation you have. It is listed in the unstable build's documentation and has been for some time.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...