Move selected items from one listbox to another in C# winform

前端 未结 7 1680
闹比i
闹比i 2020-12-06 02:41

I\'m trying to move selected items in list box1 to list box2, and vice versa. I have two buttons, >> and <<. When I select items in lis

7条回答
  •  心在旅途
    2020-12-06 03:20

    Here Two ListBoxes. When i select the name from Left listbox and click ">>" Button the data move to Right ListBox

    Code.. currentItemText = LeftListBox.SelectedValue.ToString(); currentItemIndex = LeftListBox.SelectedIndex;

            RightListBox.Items.Add(currentItemText);
            if (myDataList != null)
            {
                myDataList.RemoveAt(currentItemIndex);
            }
            ApplyDataBinding(); 
    

提交回复
热议问题