Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 363413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:20:25+00:00 2026-05-12T13:20:25+00:00

How do i drag files or folders into a textbox? i want to put

  • 0

How do i drag files or folders into a textbox? i want to put the foldername in that very textbox. C# .NET

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T13:20:25+00:00Added an answer on May 12, 2026 at 1:20 pm

    i wrote this code based in this link

      public partial class Form1 : Form
      {
        public Form1()
        {
          InitializeComponent();
        }
    
        private void Form1_Load(object sender, EventArgs e)
        {
          textBox1.AllowDrop = true;
          textBox1.DragEnter += new DragEventHandler(textBox1_DragEnter);
          textBox1.DragDrop += new DragEventHandler(textBox1_DragDrop);
    
        }
    
        private void textBox1_DragEnter(object sender, DragEventArgs e)
        {
          if (e.Data.GetDataPresent(DataFormats.FileDrop))
            e.Effects = DragDropEffects.Copy;
          else
            e.Effects = DragDropEffects.None; 
        }
    
        private void textBox1_DragDrop(object sender, DragEventArgs e)
        {
          string[] FileList = (string[])e.Data.GetData(DataFormats.FileDrop, false);
    
    
        string s="";
    
        foreach (string File in FileList)
        s = s+ " "+ File ;
        textBox1.Text = s;
        }
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to develop a tree of folders and files with a drag-and-drop upload
I'm trying to make it possible to drag files from the Finder into my
Is there, in silverlight, the ability to drag and drop files from the desktop
In my application the user can drag and drop multiple text files onto a
I have a silverlight upload control. It handles drag&drop for files, quite good. Users
When you drag a block of text from a Word document into a Java
I started trying to implement drag-and-drop of virtual files (from a C# 4/WPF app)
I want to put an alias to a fixed folder, namely the iWorks template
I need to copy the Localizable.Strings files/folders from one Xcode project to another. I'm
After working on my project for a while, I want to rearrange my files.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.