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 7158439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:03:58+00:00 2026-05-28T13:03:58+00:00

I have, what should be, a simple question on drag’n’drop. I have a fresh

  • 0

I have, what should be, a simple question on drag’n’drop. I have a fresh Win Form project where the form has set to allow drops using AllowDrop = true. Should also mention that I am running Windows 7 64-bit.

Just to be sure, I have subscribed to

this.DragDrop += new System.Windows.Forms.DragEventHandler(Form1_DragDrop);

as well.

But when I run the app and drag anything from my desktop or explorer, it indicates with the mouse pointer icon that I am not allowed to drop any file(s) to it after all.

I found a a similar question like this one (but Win Vista) where the issue was that Visual Studio was running with admin priveleges which windows explorer wasn’t. But building the app and running the executable results in the same problem.

I have done this many times in the past and couldn’t Google my way to solve this one. What am I missing?

  • 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-28T13:03:59+00:00Added an answer on May 28, 2026 at 1:03 pm

    By default the target drop effect of a drag-and-drop operation is not specified (DragDropEffects.None). Thus there is no drop event for your control in this case.
    To allow Control to be a drag-and-drop operation’s receiver for the specific data you should specify the concrete DardDropEffect as shown below (use the DragEnter or DragOver events):

    void Form1_DragDrop(object sender, DragEventArgs e) {
        object data = e.Data.GetData(DataFormats.FileDrop);
    }
    void Form1_DragEnter(object sender, DragEventArgs e) {
        if(e.Data.GetDataPresent(DataFormats.FileDrop)) {
            e.Effect = DragDropEffects.Copy;
        }
    }
    

    Related MSDN article: Performing a Drag-and-Drop Operation in Windows Forms

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Simple question... I have controls that the user can drag around on my form
Hey guys I have what should be a simple question, but I am new
I have a simple question. Should I return a byte-array or simply base64 encode
I have public site with some forms. Simple question: What kind of informations should
I have a very simple yes no question: should static methods have same result
This should be a simple question. I have a simple if/else statement: <?php //
This should be a very simple question. I have a richfaces tree that is
I think this should be a simple question to answer. I have the next
I have a rather simple question for you.. I feel like I should have
This seems like it should be a simple question. I have two QSpinBoxes in

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.