Help needed with converting C# to VB

Discussion in 'ASP .Net' started by staeri, Oct 23, 2008.

  1. staeri

    staeri Guest

    I need help converting the following code from C# to VB:

    int[] selectedIndexProducts = ListBoxProducts.GetSelectedIndices();
    string[] selectedProducts = new string[selectedIndexProducts.Length];

    int i = 0;
    foreach (int var in selectedIndexProducts)
    {
    selectedProducts[i++] = ListBoxProducts.Items[var].Value;
    }

    Especially this line is difficult for me to convert:
    "selectedProducts[i++] = ListBoxProducts.Items[var].Value;"

    I'm very grateful for help!

    // SE
     
    staeri, Oct 23, 2008
    #1
    1. Advertisements

  2. www.developerfusion.com/tools/convert/csharp-to-vb/
    http://msdn.microsoft.com/en-us/library/aa691322.aspx

    selectedProducts(i) = ListBoxProducts.Items(var).Value
    i = i + 1
     
    Alexey Smirnov, Oct 23, 2008
    #2
    1. Advertisements

  3. staeri

    staeri Guest

    Thank you very much! You solved my problem!

    // SE
     
    staeri, Oct 23, 2008
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.