笨小孩做开发

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
/// <summary>
         ///  移除

         /// </summary>

         /// <param name="sender"></param>

         /// <param name="e"></param>

         private void panBtn_GwMove_Click(object sender, EventArgs e)

         {

             if (this.lisgangwei.SelectedItem != null)

             {

                 int index = this.lisgangwei.SelectedIndex;

                 if (lisgangwei.Items.Count > 1)

                 {

                     if (this.lisgangwei.SelectedIndex ==
this.lisgangwei.Items.Count - 1)

                     {

                         this.lisgangwei.SelectedIndex = index - 1;

                     }

                     else

                     {

                         this.lisgangwei.SelectedIndex = index + 1;

                     }

                 }


                 this.lisgangwei.Items.RemoveAt(index);

             }

         }
posted on 2013-01-06 14:21  笨小孩做开发  阅读(149)  评论(0编辑  收藏  举报