How to add Items in a microsoft .net combobox - Forum - Mobile - Progress Community

How to add Items in a microsoft .net combobox

 Forum

How to add Items in a microsoft .net combobox

  • I have defined a combo box in my form.

    define private variable comboBoxRoles as System.Windows.Forms.ComboBox no-undo.

    In a method I would like to re-fill this combobox.

    First lclear it with:

    comboBoxRoles:Items:Clear().
    comboBoxRoles:ResetText().

    In a for each tt-table a want to fill the combobox with add-first or add-last method.

    I have tried several syntax but not the right one.

    comboBoxRoles:Items:add-first(cDescription, tt-Table.GroupID).

    comboBoxRoles::add-first(cDescription, tt-Table.GroupID).

    Can someone help me.

    The syntax help in PSDOE for these Microsoft Controls does not help much.

    Where can you find syntax good syntax support for progress on those Microsoft Controls .

    Thanks and regards,

    Peter Wokke.

  • You will never ever find methods with hyphens (minus/dash/ -) in the name in any .NET class – as that is an illegal character in .NET identifiers.
     
    I don’t have too much experience with the plain ugly Microsoft Controls (I prefer the UltraControls) but the reference is here:

    http://msdn.microsoft.com/en-us/library/system.windows.forms.combobox_methods(v=vs.110).aspx

    or here:

    http://msdn.microsoft.com/en-us/library/system.windows.forms.combobox.items(v=vs.110).aspx

    or here:

    http://msdn.microsoft.com/en-us/library/system.windows.forms.combobox.objectcollection_methods(v=vs.110).aspx

     

    Something like:

    comboBoxRoles:Items:add(cDescription) .

     

     

     

     

    Architect of the SmartComponent Library and WinKit

    Consultingwerk Ltd.

  • Mike,

    I can use the UltraControls as well.

    Does it has has the option to add first and add last.

    I would like to set the default user role at the first entry in the ComboBox.

    Thanks and regards,

    Peter

  • Most collections have an Add that typically adds at the end and an Insert that allows to insert at any position you like – including 0.

    Architect of the SmartComponent Library and WinKit

    Consultingwerk Ltd.

  • Thank you kindly Mike.