小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

在C#中實現(xiàn)兩個listbox的項移動(winform)

 昵稱10504424 2013-02-20
      1. using System;  
      2. using System.Collections.Generic;  
      3. using System.ComponentModel;  
      4. using System.Data;  
      5. using System.Drawing;  
      6. using System.Linq;  
      7. using System.Text;  
      8. using System.Windows.Forms;  
      9.   
      10. namespace arblistbox  
      11. {  
      12.     public partial class Form1 : Form  
      13.     {  
      14.         public Form1()  
      15.         {  
      16.             InitializeComponent();  
      17.   
      18.         }  
      19.   
      20.         private void button1_Click(object sender, EventArgs e)  
      21.         {  
      22.             if (listBox1.Items.Count == 0)  
      23.                 return;  
      24.             if (listBox1.SelectedItem == null)  
      25.                 return;  
      26.             listBox2.Items.Add(listBox1.SelectedItem);  
      27.             listBox1.Items.Remove(listBox1.SelectedItem);  
      28.               
      29.   
      30.         }  
      31.   
      32.         private void button2_Click(object sender, EventArgs e)  
      33.         {  
      34.             if (listBox1.Items.Count == 0)  
      35.                 return;  
      36.             for(int i=0;i<listBox1.Items.Count;i++)  
      37.             {  
      38.                listBox2.Items.Add(listBox1.Items[i]);  
      39.             }  
      40.   
      41.             for (int j = 0; j< listBox2.Items.Count;j++)  
      42.             {  
      43.                 listBox1.Items.Remove(listBox2.Items[j]);  
      44.             }  
      45.   
      46.         }  
      47.   
      48.         private void button3_Click(object sender, EventArgs e)  
      49.         {  
      50.             if (listBox2.Items.Count == 0)  
      51.                 return;  
      52.             if (listBox2.SelectedItem == null)  
      53.                 return;  
      54.             listBox1.Items.Add(listBox2.SelectedItem);  
      55.             listBox2.Items.Remove(listBox2.SelectedItem);  
      56.   
      57.         }  
      58.   
      59.         private void button4_Click(object sender, EventArgs e)  
      60.         {  
      61.             if (listBox2.Items.Count == 0)  
      62.                 return;  
      63.             for (int i = 0; i < listBox2.Items.Count; i++)  
      64.             {  
      65.                 listBox1.Items.Add(listBox2.Items[i]);  
      66.             }  
      67.   
      68.             for (int j = 0; j < listBox1.Items.Count; j++)  
      69.             {  
      70.                 listBox2.Items.Remove(listBox1.Items[j]);  
      71.             }  
      72.   
      73.         }  
      74.     }  
      75. }  

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多