Help for ColorSelectBox class ────────────────────────────── Present a color picker dialog, and return the selected color COM ProgID: RobvanderWoude.ColorSelectBox ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ Properties (Note that all properties are string or integer, no booleans, objects or arrays) │ │ │ ╞════════════════════╤════════════════════════════════════════════════════╤═══════════╤═══════════╤════════════════════════════════════════════╡ │ Property Name │ Description │ Mandatory │ Read-Only │ Default (Allowed) Values │ ╞════════════════════╪════════════════════════════════════════════════════╪═══════════╪═══════════╪════════════════════════════════════════════╡ │ allnames │ Return a semi-colon list of all names matching │ no │ no │ 0 │ │ │ the selected RGB value, instead of the first │ │ │ │ │ │ match only (0=false; 1=true) │ │ │ │ ├────────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼────────────────────────────────────────────┤ │ allowcustomcolors │ Enable custom colors in dialog (0=false; 1=true) │ no │ no │ 1: allow │ │ │ (ignored if consolecolorsonly equals 1) │ │ │ │ ├────────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼────────────────────────────────────────────┤ │ consolecolorsonly │ Standard 16 console colors only (0=false; 1=true) │ no │ no │ 1 │ ├────────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼────────────────────────────────────────────┤ │ debuginfo │ A log of actions for debugging │ N/A │ YES │ │ ├────────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼────────────────────────────────────────────┤ │ errors │ List of errors with current settings │ N/A │ YES │ │ ├────────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼────────────────────────────────────────────┤ │ left │ Offset of window from left screen border │ no │ no │ Centered (0..screenwidth - dialogwidth) │ │ │ (ignored if consolecolorsonly equals 0) │ │ │ │ ├────────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼────────────────────────────────────────────┤ │ modal │ Modal dialog, i.e. always on top (0=false; 1=true) │ no │ no │ 1: always on top │ │ │ (ignored if consolecolorsonly equals 0) │ │ │ │ ├────────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼────────────────────────────────────────────┤ │ selectedcolorB │ Blue component of selected color │ no │ no │ 0 (0..255) │ ├────────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼────────────────────────────────────────────┤ │ selectedcolorG │ Green component of selected color │ no │ no │ 0 (0..255) │ ├────────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼────────────────────────────────────────────┤ │ selectedcolorname │ Name of selected color │ no │ no │ Black │ ├────────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼────────────────────────────────────────────┤ │ selectedcolorR │ Red component of selected color │ no │ no │ 0 (0..255) │ ├────────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼────────────────────────────────────────────┤ │ selectedcolorRGB │ RGB values of selected color │ no │ no │ 0,0,0 │ ├────────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼────────────────────────────────────────────┤ │ timeout │ Optional dialog timeout in seconds (0=no timeout) │ no │ no │ 0: no timeout │ │ │ (ignored if consolecolorsonly equals 0) │ │ │ │ ├────────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼────────────────────────────────────────────┤ │ timeoutelapsed │ Timeout elapsed status (0=false; 1=true) │ N/A │ YES │ │ ├────────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼────────────────────────────────────────────┤ │ title │ Dialog window title │ no │ no │ Pick a Console Color │ │ │ (ignored if consolecolorsonly equals 0) │ │ │ │ ├────────────────────┼────────────────────────────────────────────────────┼───────────┼───────────┼────────────────────────────────────────────┤ │ top │ Offset of window from top of screen │ no │ no │ Centered (0..screenheight - dialogheight) │ │ │ (ignored if consolecolorsonly equals 0) │ │ │ │ └────────────────────┴────────────────────────────────────────────────────┴───────────┴───────────┴────────────────────────────────────────────┘ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ 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 │ │ ├────────────────────┼────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────┤ │ ListConSoleColors │ Returns a semicolon-separated list of console color name=value pairs │ │ ├────────────────────┼────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────┤ │ ListKnownColors │ Returns a semicolon-separated list of known color name=value pairs │ │ ├────────────────────┼────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────┤ │ 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 color picker dialog based on the current property values, and │ │ │ │ if "OK" is clicked, saves the selected color name in the │ │ │ │ "selectedcolorname" property, and the RGB color values in the │ │ │ │ "selectedcolorRGB", "selectedcolorR", "selectedcolorG" and │ │ │ │ selectedcolorB" properties (if "Cancel" is clicked, the values for the │ │ │ │ default color Black are returned). │ │ └────────────────────┴────────────────────────────────────────────────────────────────────────────┴────────────────────────────────────────────┘ Notes: ColorSelectBox actually uses 2 different color picker dialogs: if "consolecolorsonly" equals 0 (false), Windows' native color dialog is used, and you have a choice to allow custom colors or not; if "consolecolorsonly" equals 1 (true), a custom, minimalistic dialog is used, with only the 16 standard console colors and nothing else, not even "OK" and "Cancel" buttons, but it does come with a timeout option. VBScript usage example: ─────────────────────── Set objColorSelectBox = CreateObject( "RobvanderWoude.ColorSelectBox" ) With objColorSelectBox .allowcustomcolors = 1 .consolecolorsonly = 0 .Show WScript.Echo .ListProperties( ) WScript.Echo .consolecolorsonly = 1 .Show WScript.Echo .ListProperties( ) End With Set objColorSelectBox = Nothing