I have an upload/download web service that I created with WCF. Im using c sharp as the language.
I have allow drop enabled on my textbox that accepts the items to be dragged into it, but it does not allow me to do it, I still get that no sign hovering over it.
Is there something that Im missing?
FYI I made another program using the exact same code and I was able to drag and drop items no problem.
private void FileTextBox_DragEnter(object sender, DragEventArgs e)
{
//Makes sure that the user is dropping a file, not text
if (e.Data.GetDataPresent(DataFormats.FileDrop, false) == true)
//Allows them to continue
e.Effect = DragDropEffects.Copy;
else
e.Effect = DragDropEffects.None;
}
private void FileTextBox_DragDrop(object sender, DragEventArgs e)
{
String[] files = (String[])e.Data.GetData(DataFormats.FileDrop);
foreach (string file in files)
{
FileTextBox.Text = file.ToString();
}
}
these aren’t the only code that you need. you will need:
Of course, if you’re using an IDE, you can achieve this by assigning the handlers in the form designer.