+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 10 of 14

Thread: listview

  1. #1
    Programming Professional Siten0308 will become famous soon enough Siten0308's Avatar
    Join Date
    Jun 2008
    Location
    California, USA
    Posts
    302

    Question listview

    Hello,

    I am practicing right now using collections, my problem or question, what is the best and easy way to use 2 forms, the main form is going to have the listview, the second form is where you have text boxes that will have the user type in a string and/or int (whatever the variable type be) what you want that will go into its designated column(s) in the main form (form1) listview? and maybe taking it a step further and able to delete from listview? So far many examples are complicated to me (yes sadly i am still a beginner programmer). FYI i am using Visual studio 2008 express, i got the list view and naming down, but I am sure i am over complicating things but a good explanation would really help as well as a simple example that would just need one text box and a listview with one column would help greatly.

    Thank you

  2. #2
    Programming Professional Siten0308 will become famous soon enough Siten0308's Avatar
    Join Date
    Jun 2008
    Location
    California, USA
    Posts
    302

    Question Re: listview

    any ideas how to do this using the Dictionary<> collection?

  3. #3
    Newbie acer2004 is an unknown quantity at this point
    Join Date
    Nov 2008
    Location
    Egypt
    Posts
    4

    Re: listview

    I wanna help you, but i don't think I understand well what you want to do, and what it the main function of the second form

  4. #4
    Xav
    Xav is offline
    Code Slinger Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav's Avatar
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,218
    Blog Entries
    13

    Re: listview

    Do you know how to use a Ditionary<> collection?

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

  5. #5
    Newbie dairyman is an unknown quantity at this point
    Join Date
    Dec 2008
    Posts
    2

    Re: listview

    s...

  6. #6
    Xav
    Xav is offline
    Code Slinger Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav's Avatar
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,218
    Blog Entries
    13

    Re: listview

    I don't understand you, dariyman.

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

  7. #7
    Programming Professional Siten0308 will become famous soon enough Siten0308's Avatar
    Join Date
    Jun 2008
    Location
    California, USA
    Posts
    302

    Question Re: listview

    Hello,

    Sorry for the late reply everyone, really i just wanted to know if there is an easier way to import data from one form to another in a list view, example. form1 has listview, form2 has textboxes which the data from the text box will be associated with the columns in the listview in form1. Wondering how that can be accomplished in a easy way, ya actually xav someone shows me how which seemed a little complicated and i did it, but wondering if there is other ways of doing it, or should i stick everything in one form and just call it a day : )

    Thanks in advance

  8. #8
    Xav
    Xav is offline
    Code Slinger Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav's Avatar
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,218
    Blog Entries
    13

    Re: listview

    As long as you have an object reference to the instance of the form from the other, you can always access the members (and hence controls) of the other form.

    Form1.cs
    Code:
    Form2 frm;
    
    Button1_Click(EventArgs e, object sender)
    {
     frm = new Form2();
     frm.Show();
    
     //The magic part:
     MessageBox.Show("The textbox in the other form says: " + frm.textBox1.Text);
    }

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

  9. #9
    Programming Professional Siten0308 will become famous soon enough Siten0308's Avatar
    Join Date
    Jun 2008
    Location
    California, USA
    Posts
    302

    Question Re: listview

    Cool got that part thanks Xav but going back to the listview in form1 and textboxes associated in form2, have you or anyone written a simple program using this scenario? if so can ya show me such as post it?

  10. #10
    Xav
    Xav is offline
    Code Slinger Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav's Avatar
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,218
    Blog Entries
    13

    Re: listview

    What exactly do you want to do? Do you want a modal dialog form to pop up, with textboxes in it? And when you close the window (click "Save" or something), the item is added to the listview?

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

+ Reply to Thread
Page 1 of 2
1 2 LastLast

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 MXTECH in forum Visual Basic Programming
    Replies: 3
    Last Post: 11-17-2008, 12:25 PM
  2. editing listview
    By Siten0308 in forum C# Programming
    Replies: 0
    Last Post: 11-06-2008, 02:45 PM
  3. textbox to listview
    By Siten0308 in forum C# Programming
    Replies: 13
    Last Post: 11-05-2008, 03:46 PM
  4. Listview problems
    By wygz in forum Visual Basic Programming
    Replies: 2
    Last Post: 02-15-2008, 10:37 PM
  5. Detecting Column Click In ListView Control
    By MardukLitzer in forum C and C++
    Replies: 0
    Last Post: 11-26-2007, 11:02 PM