Drag drop event work fine on Windows 7 or old Operating systems. But won't work on Windows 8. How to fix?
private void listBox1_DragEnter(objectsender, DragEventArgs e)
{
e.Effect = DragDropEffects.All;
}
private void listBox1_MouseDown(objectsender, MouseEventArgs e)
{
Point sonnokta = new Point(e.X,e.Y);
int item_index = listBox1.IndexFromPoint(sonnokta);
if(e.Button == MouseButtons.Left)
{
listBox1.DoDragDrop(listBox1.Items[item_index],DragDropEffects.All);
}
}
private void listBox2_DragOver(objectsender, DragEventArgs e)
{
if(e.KeyState == 1)
{
e.Effect = DragDropEffects.All;
}
}
private void listBox2_DragDrop(objectsender, DragEventArgs e)
{
listBox2.Items.Add(e.Data.GetData(DataFormats.Text));
}