property Column.Prompt as String
Indicates the developer-specified prompt when the associated edit control contains no text.

 TypeDescription 
   String A String expression that specifies the prompt is a label or short instruction placed inside an editable drop-down list as its default value.  
By default, the Prompt property is empty. The Prompt gets displayed only if the control's Style property is DropDown or Simple ( as an editable area is provided in the control's label ). A prompt is a label or short instruction placed inside an editable drop-down list as its default value. Unlike static text, prompts disappear from the screen once users type something into the combo box or it gets input focus. Use the SingleEdit property to specify whether the control's label displays a single or multiple columns. The EditText property to change the text being displayed in the control's label, while the Style property is DropDown or Simple. 

Use a prompt when:

For instance, the following Prompt "<font Arial;8><fgcolor=808080><i><b>type to search<r><img>1</img>" is showing as follows , and so the image gets aligned to the right due <r> field, and the text gets aligned to the left.

If you are changing the column's prompt at runtime, you need to call the EditText property as follows, else the prompt will not be updated until a change occurs:

With ComboBox1
        .Columns(0).Prompt = "<img>1</img><i><fgcolor=808080>type to search</fgcolor></i>"
        .EditText(0) = ""
End With

The following screen shot shows how the prompt is disappearing as soon as the user starts typing characters, and a new item gets selected:

 

The Prompt property supports the built-in HTML tags listed here.


Send comments on this topic.
1999-2017 Exontrol.COM, Software. All rights reserved.