method Record.Add (Label as Variant, Type as EditTypeEnum, [Key as Variant])
Adds an editor and returns a reference to the newly created object.

 TypeDescription 
   Label as Variant A string expression that indicates the label of the editor. The Label paramater may include built-in HTML format like described bellow.  
   Type as EditTypeEnum An EditTypeEnum expression that indicates the type of the editor being added.  
   Key as Variant A Variant expression that indicates the key of the editor being added. If missing, the editor's key is the editor's label.    
 ReturnDescription 
  EditorAn Editor object being created. 
The Add method adds a new editor to the control. Use the DataSource property to bind a recordset to the control. The Value property indicates the editor's value. Use the UserEditor method to create an inner ActiveX control, if the Type parameter is UserEditorType. Use the Label property to get the editor's label. Use the Item property to access an editor by its key or by its index. Use the Layout property to arrange fields in the control. Use the BeginUpdate and EndUpdate methods to maintain the performance while adding multiple editors. Use the EnsureVisible method to ensures that an editor fits the control's client area. Use the EditType property to change the editor's type at runtime. Use the Remove method to remove an editor. Use the UserData property to associate an extra data to an editor.

The following VB sample adds an editor to mask a phone number:

With Record1
   .BeginUpdate
    With .Add("Phone", EXRECORDLibCtl.MaskType)
        .Mask = "(###) ### - ####"
        .Value = "(245) 282 - 1290"
   End With
   .EndUpdate
End With 

The following VC sample adds a password editor:

COleVariant vtMissing; vtMissing.vt = VT_ERROR;
CEditor editor = m_record.Add(COleVariant("Password"), /*EditType*/ 1, vtMissing );
editor.SetOption( /*exEditPassword*/ 18, COleVariant( (long)TRUE ) );
editor.SetValue( COleVariant( "pass" ) );

The Label parameter may include built-in HTML tags like follows:

Newer HTML format supports subscript and superscript like follows:

Also, newer HTML format supports decorative text like follows:

 


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