That night, I was waiting for the manager to score me. That night, the manager scored
Using System; using System. collections. generic; using System. componentModel; using System. data; using System. drawing; using System. linq; using System. text; using System. threading. tasks; using System. windows. forms; namespace pf {public partial class Form1: Form {public Form1 () {InitializeComponent ();} private void lvShow_SelectedIndexChanged (object sender, EventArgs e) {} private void lvShow_DoubleClick (object sender, EventArgs e) {Form2 frm = new Form2 (); frm. name = lvShow. selectedItems [0]. subItems [1]. text; ListViewItem selectRow = lvShow. selectedItems [0]; frm. myitem = selectRow; frm. show ();} private void Form1_Load (object sender, EventArgs e) {InitData (); foreach (UserInfo item in users) {ListViewItem lvitems = new ListViewItem (item. id); lvitems. subItems. add (item. name); lvitems. subItems. add (item. age. toString (); lvitems. subItems. add (item. assess); lvitems. subItems. add (item. score. toString (); lvShow. items. add (lvitems) ;}} UserInfo [] users = new UserInfo [3]; private void InitData () {users [0] = new UserInfo (); users [0]. id = "001"; users [0]. name = "James"; users [0]. age = 12; users [1] = new UserInfo (); users [1]. id = "002"; users [1]. name = "Li Si"; users [1]. age = 22; users [2] = new UserInfo (); users [2]. id = "003"; users [2]. name = "Haha"; users [2]. age = 2 ;}}}
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace pf{ public partial class Form2 : Form { public Form2() { InitializeComponent(); } public string name; public ListViewItem myitem; private void Form2_Load(object sender, EventArgs e) { textBox1.Text = name; textBox2.Text = myitem.SubItems[3].Text; textBox3.Text = myitem.SubItems[4].Text; } private void button1_Click(object sender, EventArgs e) { myitem.SubItems[3].Text = textBox2.Text; myitem.SubItems[4].Text = textBox3.Text; this.Hide(); } private void button2_Click(object sender, EventArgs e) { this.Hide(); } }}
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace pf{ public class UserInfo { public string id { get; set; } public string Name { get; set; } public int Age { get; set; } public string assess { get; set; } public int Score { get; set; } } }