1

I have one "CCombo" box and one List. i want all the items of List gets loaded into it when user clicks on its dropdown. but the problem is that if user clicks many times on the drop down then items gets added into it again and again. And while displaying these elements on the UI. User find duplicate items.

So I just want to know, can we remove duplicate items from the CCombo. If yes then please guide me.

Andrew Barber
  • 39,603
  • 20
  • 94
  • 123
User_86
  • 265
  • 1
  • 4
  • 13

1 Answers1

1

Use removeAll() or remove(int start, int end) of CCombo.

Ref:http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fswt%2Fcustom%2FCCombo.html

Ravindra Gullapalli
  • 9,049
  • 3
  • 48
  • 70
  • Thanks for your quick reply. but i am using "CCombo" of this org.eclipse.swt.custom.CCombo; package. – User_86 Feb 07 '13 at 12:09
  • i am calling the method which does above things from the "Focus" event. if i delete all the element from combo box before adding element, then i click on the combo box it gets cleared. – User_86 Feb 07 '13 at 12:13