"C #" file drag-and-drop to form

Source: Internet
Author: User

///<summary>///When the form loads, the settings allow the file to be dragged and dropped///</summary> <param name= "Sender" ></param>//<param name= "E" ></param> private void form1_ Load (object sender, EventArgs e) {//Set allow drag and drop properties this.        AllowDrop = true; }///<summary>///The event occurs when the file is dragged to the form///</summary>//<param name= "Sender" >& lt;/param>//<param name= "E" ></param> private void Form1_dragenter (object sender, Dragevent                Args e) {//Get drag-and-drop data if (E.data.getdatapresent (DataFormats.FileDrop)) {                string[] content = (string[]) e.data.getdata (DataFormats.FileDrop); for (int i = 0; i < content. Length; i++) {//This is the full path Label1.                Text + = Content[i]; }            }        }

  

"C #" file drag-and-drop to form

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.