Help for DropDownBox class ─────────────────────────── Present a dropdown list of choices, and return the selected value COM ProgID: RobvanderWoude.DropDownBox ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ Properties (Note that all properties are string or integer, no booleans, objects or arrays) │ │ │ ╞══════════════════╤════════════════════════════════════════════════════╤═══════════╤═══════════╤══════════════════════════════════════════════╡ │ Property Name │ Description │ Mandatory │ Read-Only │ Default (Allowed) Values │ ╞══════════════════╪════════════════════════════════════════════════════╪═══════════╪═══════════╪══════════════════════════════════════════════╡ │ captioncancel │ Caption for "Cancel" button │ no │ no │ Cancel │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ captionok │ Caption for "OK" button │ no │ no │ OK │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ debuginfo │ A log of actions for debugging │ N/A │ YES │ │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ defaultindex │ Index of initially selected item in dropdown │ no │ no │ -1: none selected │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ errors │ List of errors with current settings │ N/A │ YES │ │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ fontfamily │ Font family used in dialog │ no │ no │ Microsoft Sans Serif │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ fontsize │ Font size used in dialog │ no │ no │ 10 (6..48) │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ left │ Offset of window from left screen border │ no │ no │ Centered (0..screenwidth-windowwidth) │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ list │ Semicolon-separated list of items for dropdown │ │ no │ │ ├──────────────────┼────────────────────────────────────────────────────┤ * YES ├───────────┤ * Set either "list" or "listfile" property │ │ listfile │ Path to file containing list │ │ no │ ══════ ══ │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ literal │ Treat "prompt" as literal string (0=false; 1=true) │ no │ no │ 0: interpret "\t" as tab and "\n" as newline │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ localizecaptions │ Use localized button captions (0=false; 1=true) │ no │ no │ 0: English captions │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ modal │ Modal dialog, i.e. always on top (0=false; 1=true) │ no │ no │ 1: always on top │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ prompt │ Optional text above controls │ no │ no │ No prompt │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ selectedindex │ Index of last selected dropdown item │ N/A │ YES │ │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ selecteditem │ Text of last selected dropdown item │ N/A │ YES │ │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ timeout │ Optional dialog timeout in seconds (0=no timeout) │ no │ no │ 0: no timeout │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ timeoutelapsed │ Timeout elapsed status (0=false; 1=true) │ N/A │ YES │ │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ title │ Dialog window title │ no │ no │ DialogBoxes.dll, Version 0.18.1.0 │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ top │ Offset of window from top of screen │ no │ no │ Centered (0..screenheight-windowheight) │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ Version │ Show this DLL's version │ │ │ │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ windowheight │ Height of dialog window │ no │ no │ 90 (90..screenheight) │ ├──────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼──────────────────────────────────────────────┤ │ windowwidth │ Width of dialog window │ no │ no │ 200 (200..screenwidth) │ └──────────────────┴────────────────────────────────────────────────────┴───────────┴───────────┴──────────────────────────────────────────────┘ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ Methods │ │ │ ╞══════════════════╤════════════════════════════════════════════════════════════════════════════╤══════════════════════════════════════════════╡ │ Method Name │ Description │ Requirements │ ╞══════════════════╪════════════════════════════════════════════════════════════════════════════╪══════════════════════════════════════════════╡ │ CheckUpdate │ Check the developer's website for updates │ │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────┤ │ Credits │ Shows credits │ │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────┤ │ Help │ Returns this help text as plain text, or if optional parameter equals 1, │ │ │ │ as html │ │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────┤ │ ListProperties │ Returns a list of this class' properties as key=value pairs (1 per line) │ │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────┤ │ SampleCode │ Returns VBScript sample code for this dialog │ │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────┤ │ Show │ Presents a dropdown dialog box based on the current property values, and │ Either "list" or "listfile" property must │ │ │ if "OK" is clicked, saves the last selected item's index in │ be set │ │ │ "selectedindex" property, and its text value in "selecteditem" property │ │ │ │ (if "Cancel" is clicked, "selectedindex" is set to -1 and "selecteditem" │ │ │ │ to an empty string). │ │ └──────────────────┴────────────────────────────────────────────────────────────────────────────┴──────────────────────────────────────────────┘ VBScript usage example: ─────────────────────── Set objDropDownBox = CreateObject( "RobvanderWoude.DropDownBox" ) With objDropDownBox .list = "Arizona;Texas;California;Washington;Montana;Utah" .defaultindex = 4 .prompt = "You have 15 seconds to select a state" .top = 200 .left = 300 .timeout = 15 .Show WScript.Echo "Selected state: " & .selecteditem End With Set objDropDownBox = Nothing