Type | Description |
The following VB sample expands all items in the DropDownListType editor:
With Record1 .BeginUpdate With .Add("DropDownList", EXRECORDLibCtl.DropDownListType) .DropDownAutoWidth = False .AddItem 0, "Root 1" .InsertItem 1, "Child 1", , 0 .InsertItem 2, "Child 2", , 0 .InsertItem 3, "SubChild 2.1", , 2 .InsertItem 4, "SubChild 2.2", , 2 .AddItem 5, "Root 2" .InsertItem 6, "Child 1", , 5 .InsertItem 7, "Child 2", , 5 .InsertItem 8, "SubChild 2.1", , 6 .InsertItem 9, "SubChild 2.2", , 6 .ExpandAll .Value = 6 End With .EndUpdate End With
The following VC sample expands all items in a DropDownListType editor:
COleVariant vtMissing; vtMissing.vt = VT_ERROR; CEditor editor = m_record.Add(COleVariant("DropDownList"), /*DropDownListType*/ 3, vtMissing ); editor.SetDropDownAutoWidth( FALSE ); editor.AddItem( 0, "Root 1", vtMissing ); editor.InsertItem( 1, "Child 1", vtMissing, COleVariant( long(0) ) ); editor.InsertItem( 2, "Child 2", vtMissing, COleVariant( long(0) ) ); editor.InsertItem( 3, "SubChild 2.1", vtMissing, COleVariant( long(2) ) ); editor.InsertItem( 4, "SubChild 2.2", vtMissing, COleVariant( long(2) ) ); editor.AddItem( 5, "Root 2", vtMissing ); editor.InsertItem( 6, "Child 1", vtMissing, COleVariant( long(0) ) ); editor.InsertItem( 7, "Child 2", vtMissing, COleVariant( long(0) ) ); editor.InsertItem( 8, "SubChild 1.1", vtMissing, COleVariant( long(6) ) ); editor.InsertItem( 9, "SubChild 1.2", vtMissing, COleVariant( long(6) ) ); editor.SetValue( COleVariant( (long)6 ) ); editor.ExpandAll();