Вопрос

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?

Это было полезно?

Решение 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

Другие советы

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top