c# - show listview item in a textbox -
is a list view that stores the name from my textbox and when I select a name from the row in my list view That name will be shown back in my text box How can I do this? There is a person in which I have collected all the details of the person
list & lt; Person & gt; People = new list & lt; Person & gt; (); Private Zero Form 1_load (Object Sender, EventEurge E) {String path = Environmental. Gatefolder Path (environment specialfolder.desktop); If (! Directory. Example (path + "\\ address book data \\")) Directory.CreateDirectory (path + "\\ Address Book Data \\"); If the file ("example" (path + "\\ address book" \ "PeopleData.xml")) create file. (Path + "\\ address book data \\" PeopleData.xml "); } Private Zero Button 2_Click (Object Sender, EventArgs e) {Person P = New Person (); P.name = textbox1.Text; P.email = textbox2.Text; P.streetAddress = textBox3.Text; P.birthday = dateTimePicker1.Value; P.addtionalNote = textBox4.Text; People.Add (P); ListView1.Items.Add (p.name); TextBox1.Text = ""; TextBox2.Text = ""; Textbox3.Text = ""; TextBox4.Text = ""; DateTimePicker1.Value = DateTime.Now; }
You must set view
of ListView < Code> List .
Add follower details to form_Load:
listView1.View = View.list;
Comments
Post a Comment