Closed Thread
Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: listview

  1. #11
    Siten0308's Avatar
    Siten0308 is offline Programming Professional
    Join Date
    Jun 2008
    Location
    California, USA
    Posts
    302
    Rep Power
    16

    Wink Re: listview

    Exactly : )

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #12
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    Re: listview

    Well why didn't ya say so then?

    Form1.cs
    Code:
    Button1_Click(EventArgs e, object sender)
    {
      Form2 frm = new Form2();
      if (frm.ShowDialog() != DialogResult.OK) return;
      listView1.Items.Add(frm.textBox1.Text);
    }
    Tada!

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  4. #13
    Siten0308's Avatar
    Siten0308 is offline Programming Professional
    Join Date
    Jun 2008
    Location
    California, USA
    Posts
    302
    Rep Power
    16

    Question Re: listview

    cool thanks Xav for that,

    sorry to ask one last question what if you had multiple textboxes, would your declare each textbox giving it its own variable then putting all variables together in one dictionary collection? if that is the case would the listview.items.add("put dictionary name here"?) would that be right?

  5. #14
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    Re: listview

    ListView.Items.Add() expects a string value. If you wish to add more than one column to the list view (in Details view) then you can manipulate SubItems:

    Code:
    Button1_Click(EventArgs e, object sender)
    {
      Form2 frm = new Form2();
      if (frm.ShowDialog() != DialogResult.OK) return;
      
      ListViewItem row = listView1.Items.Add(frm.textBox1.Text);
    
      row.SubItems.Add(frm.textBox2.Text);
      row.SubItems.Add(frm.textBox3.Text);
      //etc.
    }

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

Closed Thread
Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Listview Help?????
    By jbnonn in forum C# Programming
    Replies: 3
    Last Post: 01-30-2011, 02:17 PM
  2. can fix it about listview
    By kiddies in forum Visual Basic Programming
    Replies: 2
    Last Post: 06-22-2010, 03:57 AM
  3. Help Using Listview
    By edge02 in forum Visual Basic Programming
    Replies: 2
    Last Post: 04-04-2010, 12:58 AM
  4. Selecting Row from Listview
    By Darkco in forum C# Programming
    Replies: 1
    Last Post: 01-12-2010, 12:57 PM
  5. ListView Help?
    By MXTECH in forum Visual Basic Programming
    Replies: 3
    Last Post: 11-17-2008, 12:25 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts