That night, I was waiting for the manager to score me. That night, the manager scored

Source: Internet
Author: User

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; }        }    }

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.