Quantcast
Viewing all articles
Browse latest Browse all 27225

VS 2012 VBA to VB.net syntax conversion Part 2

Need Help converting this VBA working code so it'll work in vb.net
I guess .listindex, .columnCount, .boundColumn, .columnwidths, .additem, .list, .listcount syntax doesn't exist in vb.net or does it?


Code:

'Creates list of product
    With CmbTieSize
        .ColumnCount = 2
        .BoundColumn = 2
        .ColumnWidths = .Width - 2 & ";0"    'hide the 2nd column
        .AddItem "FTB4"
        .List(.ListCount - 1, 1) = "BLACK"
        .AddItem "FTB6"
        .List(.ListCount - 1, 1) = "BLUE"
        .AddItem "FTY8"
        .List(.ListCount - 1, 1) = "YELLOW"
        .AddItem "FTG10"
        .List(.ListCount - 1, 1) = "GREEN"
        .AddItem "FTR12"
        .List(.ListCount - 1, 1) = "RED"
        .AddItem "FTB14"
        .List(.ListCount - 1, 1) = "BROWN"
        .AddItem "XT"
        .List(.ListCount - 1, 1) = "ORANGE"
        .AddItem "BLT"
        .List(.ListCount - 1, 1) = "BLACK"
    End With

and
Code:

'Enters Label color
Private Sub CmbTieSize_Change()
    With CmbTieSize
        If .ListIndex > -1 Then
            LblTieColorDisplay.Caption = .Value
        End If
    End With

End Sub

Thanks again for everyone's help.

Viewing all articles
Browse latest Browse all 27225

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>