コード例 #1
0
 private void AllLeftButton_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < LeftListBox.Items.Count; i++)
     {
         LeftListBox.SetSelected(i, true);
     }
 }
コード例 #2
0
        private void MoveRightButton_Click(object sender, EventArgs e)
        {
            // If right side object is selected add it to left side.
            for (int i = 0; i < LeftListBox.Items.Count; i++)
            {
                if (LeftListBox.GetSelected(i) == true)
                {
                    RightListBox.Items.Add(LeftListBox.Items[i]);
                }
            }

            for (int i = LeftListBox.Items.Count - 1; i <= 0; i--)
            {
                if (LeftListBox.GetSelected(i) == true)
                {
                    LeftListBox.Items.RemoveAt(i);
                }
            }
        }