alekkh
November 7th, 2005, 09:52 PM
I'm trying to open a file in Windows Forms by DragDrop, DrgEnter.
Everything works fine except I cannot seem to obtain the FileName from which to open the file: I always get "System.String[]" as the file destination...
Searching forums gave some results but nothing worked for me. Pleas help with just one string of code in C++!..
++++++
working example::::
public: System::Void Form1_DragDrop(System::Object^ sender, System::Windows::Forms::DragEventArgs^ e) {
textBox1-> Text = "OK";
}
++++++++
works nicely and inserts "OK"
but
non-working example:::::
public: System::Void Form1_DragDrop(System::Object^ sender, System::Windows::Forms::DragEventArgs^ e) {
this->textBox5 ->Text = Convert::ToString(e->Data->GetData(DataFormats::FileDrop, "FileName"));
}
inserts "System.String[]" instead of file name of the file that I dragged and dropped.
How to make it return i.e.
"C:\Programs... " instead??? Many thanks.
Everything works fine except I cannot seem to obtain the FileName from which to open the file: I always get "System.String[]" as the file destination...
Searching forums gave some results but nothing worked for me. Pleas help with just one string of code in C++!..
++++++
working example::::
public: System::Void Form1_DragDrop(System::Object^ sender, System::Windows::Forms::DragEventArgs^ e) {
textBox1-> Text = "OK";
}
++++++++
works nicely and inserts "OK"
but
non-working example:::::
public: System::Void Form1_DragDrop(System::Object^ sender, System::Windows::Forms::DragEventArgs^ e) {
this->textBox5 ->Text = Convert::ToString(e->Data->GetData(DataFormats::FileDrop, "FileName"));
}
inserts "System.String[]" instead of file name of the file that I dragged and dropped.
How to make it return i.e.
"C:\Programs... " instead??? Many thanks.