Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3974712
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:36:00+00:00 2026-05-20T04:36:00+00:00

I am trying to get the following VB6 listindex to work within my vb.net

  • 0

I am trying to get the following VB6 listindex to work within my vb.net code:

setTheR CStr(payReq.ItemData(payReq.ListIndex))

But if i copy and paste that into VB.net it wont accept it.

This is what VB.net did with the converting of the VB6 to .net code:

strContract = payReq.Items.Item(payReq.FocusedItem.Index).Text

However, checking that value it returns the name instead of the index. While the VB6 code returns the value of 2311 (which is what it needs to return)

When i add items to the listview i do this:

Item = payReq.Items.Add(rsPayRequests.Fields("userid").Value)
Item.SubItems.Insert(1, New System.Windows.Forms.ListViewItem.ListViewSubItem(Nothing,   VB6.Format(rsPayRequests.Fields("reqdatetime").Value, "mm/dd/yyyy")))

But i noticed it does this as well:

payReq.Items.Add(New VB6.ListBoxItem(Item, rsPayRequests.Fields("requestNum").Value))

But that does not work with my listview in .net since that above is a listbox and not a listview. Is there an equivalent in .net for the listbox to have a custom index?

Any help would be great!

David

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T04:36:01+00:00Added an answer on May 20, 2026 at 4:36 am

    Try strContract = lstPayRequest.FocusedItem.Index
    The way you are using it is returning the item at that index

    Edit:
    To answer your question you can add subitems to a listviewitem or you could use the tag property of the ListViewItem for your custom index.

        Dim lv As New ListViewItem
        lv.Text = "Item1"
        lv.Tag = 1001     
        lv.SubItems.Add("SubItem1")
        lv.SubItems.Add("SubItem2")
        lstPayRequests.Items.Add(lv)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get the following bit of code to work in LINQPad but
I'm trying to get the following code to work, but it's giving me an
I'm trying to get the following code to work using both Watin and HttpWatch.
I am trying to get the following code to work: if (isset($_POST['file'])){ if(file_exists($_POST['file'])){ echo
I am trying to get the following ternary conditional to work in Asp.Net MVC
I am trying to get the following code to compile but am getting errors
Trying to get the following sprite to work http://reversl.net/sprites/ on hover. Here's my styling
I'm trying to get the following to work, but I'm at a loss... class
I am trying to get the following code to work so I can call
I am trying to get the following piece of code to work in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.