Listview:
1 / / the column names of each column are added with the columns set
2 ListViewItem lv = new ListViewItem();
3 Lv. Text = s.code. Tostring(); / / items in the first column of each row are added through text
4 Lv. Subitems. Add (s.name); / / items of other columns in each row are added through the subitems collection
5 lv.SubItems.Add(s.Sex);
6 Lv. Subitems. Add (s.birthday. ToString ("mm / DD / yyyy));
7 lv.SubItems.Add(s.Score.ToString("#.##"));
8 listview1. Items. Add (LV); / / each line is added with the items collection, and the added data is the value of each item above
A simple Notepad operation:
1 private void exit xtoolstripmenuitem [click (object sender, EventArgs E)
2 {
3 this.Close();
4}
5
6 private void undo utoolstripmenuitem [click (object sender, EventArgs E)
7 {
8 textBox1.Undo();
9}
10
11 private void cut ttoolstripmenuitem [click (object sender, EventArgs E)
12 {
13 textBox1.Cut();
14}
15
16 private void copy ctolstripmenuitem [click (object sender, EventArgs E)
17 {
18 textBox1.Copy();
19}
20
21 private void paste ptoolstripmenuitem [click (object sender, EventArgs E)
22 {
23 textBox1.Paste();
24}
25 26 private void select atools stripmenuitem [click (object sender, EventArgs E)
27 {
28 textBox1.SelectAll();
29}
ListView and Simple Notepad operations