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

  • SEARCH
  • Home
  • 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 8332213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:39:30+00:00 2026-06-09T02:39:30+00:00

I have two forms in my application. In my Form1 I have a list

  • 0

I have two forms in my application. In my Form1 I have a list view having some items. When I double click on a row, I should get a pop-up window allowing me edit the row values. For this I used doubleclick event. Now for the pop-up window I created new form- Form2. I have made the listview as internal in Form1, so as to access the selected rows values in my form2. In form2 load I am retrieving the values of selected row to display in textboxes but this gives me error. This is my code:

   //this is in form1
   private void bufferedListView1_DoubleClick(object sender, EventArgs e)
    {
        form2 obj = new form2();
        obj.ShowDialog();
    }

   //in form2
   Form1 o = new Form1();
   private void form2_Load(object sender, EventArgs e)
    {
        txt_editname.Text = o.bufferedListView1.SelectedItems[0].SubItems[0].Text;
        txt_editno.Text = o.bufferedListView1.SelectedItems[0].SubItems[1].Text;
    }

The error that I get is: InvalidArgument=Value of '0' is not valid for 'index'.
Parameter name: index

Where am I wrong?

  • 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-06-09T02:39:32+00:00Added an answer on June 9, 2026 at 2:39 am

    Pass needed data in constructor of form2

    public form2(string text1, string text2)
    {
       //work with values
    }
    

    And change calling code to this:

    private void bufferedListView1_DoubleClick(object sender, EventArgs e)
    {
        form2 obj = new form2(bufferedListView1.SelectedItems[0].SubItems[0].Text,
           bufferedListView1.SelectedItems[0].SubItems[1].Text);
        obj.ShowDialog();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two forms: Form1 and Form2. I can get the contents of a
I have two versions of a Windows Forms Application and can't figure for the
I have encountered a problem in my application. I have two forms, one that
I have created two forms in my Windows Application. One Form acts as a
I have application in VB.net that have two different form (Form1 and Form2). Now
Scenario I have a windows forms application. I want to use two different WCF
I have an application that consists of two forms. One form displays data returned
I have two forms.. form1 and form2 in form1 i have gridview with three
I have been experimenting with sending messages from two .NET Windows Forms applications using
Imagine that I have a form in a flash application with two fields, input1

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.