any ideas how to do this using the Dictionary<> collection?
Thread: 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
any ideas how to do this using the Dictionary<> collection?
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
s...
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
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); }
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?
There are currently 1 users browsing this thread. (0 members and 1 guests)