Frage

In VB6 I have a line of code that will not convert in .NET, and I am unsure what the correct member should be. The error is is "NewIndex is not a member of system.windows.forms.combobox"

The code:

VB6.SetItemData(cboDrawing, cboDrawing.NewIndex, NumericClean(r.Fields.Item("DrawSafeID")))

Can someone please tell me what member I should be using?

War es hilfreich?

Lösung 2

You should change the code to be something like the following:

VB6.SetItemData(cboDrawing, cboDrawing.Items.Count - 1, NumericClean(r.Fields.Item("DrawSafeID")))

This selects the most recently added Item in the combobox

Andere Tipps

From the MSDN help:

NewIndex Property

In Visual Basic 6.0, the NewIndex property was used to retrieve the index of the item most recently added to aComboBox control.

In Visual Basic 2008, the NewIndex property no longer exists. You can use the return value from the Item.Add method to retrieve the index of an item as it is added.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top