私の ListBox MouseMove イベントのコードは次のとおりです。
private void lbxItems_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left) //this one is good
{
lbxItems.DoDragDrop("Copy Text 1", DragDropEffects.Copy);
}
else if (Control.ModifierKeys == Keys.Alt && e.Button == MouseButtons.Left) //this desn't work
{
lbxItems.DoDragDrop("Copy Text 2", DragDropEffects.Copy);
}
}
e.Button == MouseButtons.Left
条件だけでは問題ありませんが、Control.ModifierKeys == Keys.Alt
. ListBox コントロールは ALT キー + 左マウス ボタンの組み合わせを認識できるのだろうか。誰でも提案できますか?