This is the most used component. The types to be selected can be any of the following types:  "BLANK", "BLANKLINE", "CHECKBOX", "COMBOLONG", "COMBOTEXT", "DATEPICKER", "DATETIME", "TIME",  "MEMO", "NUMBERBYTE", "NUMBERDECIMAL", "NUMBERDOUBLE", "NUMBERINT", "NUMBERLONG", "NUMBERSHORT", "NUMBERSINGLE", "PICTURE" (value contains the filepath of the image) or"TEXT”


Examples of databoxes in the form of textboxes with labels, a combobox and a textbox fro larger text (Memo):




The component is set as:


<DataBox>

    <Name>SCN_LENGTHVALUE</Name>

    <TOP>0</TOP>

    <Left>5</Left>

    <Width>200</Width>

    <Height></Height>  ‘Default value is 30 for type is TEXT

    <Type>TEXT</Type>  

    <Label>Length Value:</Label>

    <LabelWidth>100</LabelWidth>

    <DataWidth></DataWidth>

    <Value>100</Value>

    <MaxLength>8</MaxLength>

    <ReadOnly>FALSE</ReadOnly>

    <ToolTip>Tooltip text..</ToolTip>

    <SelectOnFocus>FALSE</SelectOnFocus>

    <ComboDataBinding></ComboDataBinding>

    <FontStyle></FontStyle>  ‘Can be any Fontstyle text as ‘Bold’, ‘Italic’, etc

    <FormatStyle></FormatStyle>

    <ValueOutputFormat></ValueOutputFormat>

    <WordWrap>False</WordWrap>

    <Border>0</Border>

    <BorderColor></BorderColor>

    <BorderStyle></BorderStyle>

    <BorderSize></BorderSize>

    <ScriptFileOnValueChanged></ScriptFileOnValueChanged>

    <ScriptOnValueChanged></ScriptOnValueChanged>

    <ScriptFileOnTextChanged></ScriptFileOnTextChanged>

    <ScriptOnTextChanged></ScriptOnTextChanged>

</DataBox>


BorderStyle can contain any of "NONE", “TOP”, "BOTTOM", "LEFT", "RIGHT", "ALL"


Border can be 0 (default, standard or 3D border style) or 1 (Flat style)


FontStyle can contain any of "BOLD", "ITALIC", "UNDERLINE", "STRIKEOUT", "REGULAR"


LabelWidth is default 0, Value is default "".


Color can be any of the windows colornames.


By setting the labelwidth equel to the width and selecting type=”TEXT”, a label or info field is created.


Type=TIME is effectively the same as Type=DateTime with FormatStyle="HH:mm".


WordWrap can be used with MEMO. Default is true. If required, the scrollbar is automatically shown.


Properties can also be set during loading, based on another setting/variable. e.g.: 

<Enabled>not #SETTINGSDISABLE#</Enabled>



When the Type is a ComboType, it can be filled by using the following properties:


<DataBox>

   <Type>COMBOTEXT</Type>

   .. ..other properties ..                

   <ComboDataBinding>

<AddRow>

                 <Text>1st Principle</Text>

                 <Value>1</Value>

       </AddRow>

       <AddRow>

<Text>2nd Principle</Text>

               <Value>0</Value>

       </AddRow>

   </ComboDataBinding>

   <Value>0</Value>

   <MaxDropDownItems>8</MaxDropDownItems>

</DataBox>



Also the following script functions can be used to fill a combobox (both for Databoxes and Menuitems):


FillComboBoxItems(ByVal items As String, Name As String,

                                 Optional ClearBeforeFill As Boolean = True) As Boolean

AddComboBoxItem(ByVal Name As String, ByVal Value As String, 

                                 ByVal Text As String) As Boolean

ClearComboBoxItems(Name As String) As Boolean




A value change of a form databox  via script, will now cause modified events. If set, this will cause scripts to run in a queue.

Databox saves a value in tempvariable when set via script. When comboboxes items are added later, the tempvariable is used to set the item if it did not exist earlier. Note: This causes the following behaviour: 

  • Assume a combobox with items 1 And 2, combobox has default value 2. 
  • When Set via script To 3 And retrieved via script,  the value of the combobox returns 1 since 3 does not exist (yet). 
  • When adding an item 3 to the combobox list, the selected item will be the last set value (3).



The value of a Databox can be retreived as variable (#NAME# or #DB_NAME#). The text can also be retreived as variable (#DBTEXT_NAME#). Most of the times, the text is equal to the value, but e.g. combobox values and text can differ.


Note that ScriptOnValueChanged scripts are run after the databox losing focus and after the inital load. ScriptOnTextChange scripts are run with each change while having focus but are not run during load.

For a combobox to respond immediately after a change, the ScriptOnTextChange should be used.

Created with the Personal Edition of HelpNDoc: Free Kindle producer