Question

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?

Was it helpful?

Solution 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

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top