Today, during my personal coding session, I stumbled upon an annoying repetitive thing called browsing for files from the program I was developing. I am sure, I could have just provided a path to the file and not bother with browsing for the file.
Nonetheless, that coding session went well, ignored the annoyance and continued with coding. This morning, as I am typing this blog post, I decided to have a file Drag and Drop feature, might save a little time, but who knows if it will really save any amount of time.
I’ll keep it simple and show you the steps to enable Drag and Drop in your form.
Depending on your form component, choose the component you wish to enable Drag and Drop. It can be any component, I believe! You can also enable Drag and Drop in the whole form as well.
Open your code window and in the Form constructur below
InitializeComponent(); add this below it.
Add these methods below the constructor or ..
Just to not confuse you guys,
Main_ is my form’s name whereas
txtFilePath is the textbox component in the form as you can see in the post drag & drop image.