//処理待ちリストにポインタが載ったとき private void InputBox_MouseDown(object sender, MouseEventArgs e) { switch (e.Button) { case MouseButtons.Right: System.Diagnostics.Debug.WriteLine("Right Click."); //右クリックで選択できるようにする int index = InputBox.IndexFromPoint(e.Location); if (index >= 0) { InputBox.ClearSelected(); InputBox.SelectedIndex = index; } //右クリックメニューの表示 if (InputBox.SelectedIndex >= 0) { Point p = Cursor.Position; this.contextMenuStrip_DeleteInput.Show(p); } break; default: System.Diagnostics.Debug.WriteLine("わからん. " + e.Button.ToString()); break; } }