標籤:
listview:
1 //每一列的列名用Columns集合添加2 ListViewItem lv = new ListViewItem();3 lv.Text = s.Code.ToString();//每一行的第一列的項通過text添加4 lv.SubItems.Add(s.Name);//每一行的其他列的項通過SubItems集合添加5 lv.SubItems.Add(s.Sex);6 lv.SubItems.Add(s.Birthday.ToString("yyyy年MM月dd日"));7 lv.SubItems.Add(s.Score.ToString("#.##"));8 listView1.Items.Add(lv);//每一行用Items集合添加,添加的資料是上面每一項的值
簡單的記事本操作:
1 private void 退出XToolStripMenuItem_Click(object sender, EventArgs e) 2 { 3 this.Close(); 4 } 5 6 private void 撤消UToolStripMenuItem_Click(object sender, EventArgs e) 7 { 8 textBox1.Undo(); 9 }10 11 private void 剪下TToolStripMenuItem_Click(object sender, EventArgs e)12 {13 textBox1.Cut();14 }15 16 private void 複製CToolStripMenuItem_Click(object sender, EventArgs e)17 {18 textBox1.Copy();19 }20 21 private void 粘貼PToolStripMenuItem_Click(object sender, EventArgs e)22 {23 textBox1.Paste();24 }25 26 private void 全選AToolStripMenuItem_Click(object sender, EventArgs e)27 {28 textBox1.SelectAll();29 }
listview和簡單的記事本操作