Rob van der Woude's Scripting Pages

Help text for DropDownBox.cs

(view help text of DropDownBox.cs as plain text)

DropDownBox,  Version 1.11
Batch tool to present a DropDown dialog and return the selected item

Usage:    DROPDOWNBOX     [ "list" ]  [ "prompt"  [ "title" ] ]  [ options ]

Where:    "list"          is the list of items to populate the dropdown control
          "prompt"        is the optional text above the dropdown control
                          (default: none)
          "title"         is the window title
                          (default: "DropDownBox,  Version 1.11")
Options:  /W:width        sets the Width of the input box
                          (default: 200; minimum: 200; maximum: screen width)
          /H:height       sets the Height of the input box
                          (default: 90; minimum: 90; maximum: screen height)
          /C:index        use iCon at index from shell32.dll (default: 23)
          /D:"delimiter"  sets the Delimiter character for "list"
                          (default: semicolon)
          /F:"listfile"   use list from text File (one list item per line)
          /I:index        sets the zero based Index of the preselected item
                          (default: 0)
          /L[:"captions"] Localize or customize button captions
                          (e.g. /L:"OK=Why Not?;Cancel=No Way!")
          /T:tablength    sets the number of spaces for Tabs in prompt
                          (4..16; default: 4)
          /MF             use Monospaced Font in prompt (default: proportional)
          /NM             make dialog Non-Modal (default: modal, i.e. on top)
          /RI             Return code equals selected Index + 1, or 0 on
                          (command line) errors or if "Cancel" was clicked
                          (default: 0 on "OK", 1 on error, 2 on "Cancel")

Notes:    The selected item text is written to Standard Out if "OK" is clicked,
          otherwise an empty string is returned.
          Use either "list" or /F:"listfile", not both.
          Linefeeds (\n), tabs (\t) and doublequotes (\") are allowed in the
          prompt text (but not in the title); with tabs, /MF is recommended.
          If specified without captions, switch /L forces localized button
          captions (e.g. "Cancel" button caption is "Annuleren" on Dutch
          systems); if only a single custom caption is specified, the other
          one is localized (e.g. with /L:"OK=Gaan" on Dutch systems, "OK"
          button caption is "Gaan", "Cancel" button caption is "Annuleren").
          Return code 0 for "OK", 1 for (command line) errors, 2 for "Cancel".
          With /RI return code equals selected index + 1, or 0 for "Cancel".

Credits:  On-the-fly form based on code by Gorkem Gencay on StackOverflow:

          Code to retrieve localized button captions by Martin Stoeckli:

          Code to extract icons from Shell32.dll by Thomas Levesque:

Written by Rob van der Woude

page last uploaded: 2017-03-25, 21:31