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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T19:52:57+00:00 2026-05-18T19:52:57+00:00

i want to implement a Drag/Drop mechanic in WPF, but it didn’t work… With

  • 0

i want to implement a Drag/Drop mechanic in WPF, but it didn’t work…
With Windows-Forms it worked, …

First i set AllowDrop to True. In windows-forms you can already drag items into the richtextbox and the cursor changes.

With WPF …. nothing happens.

The nexT point: Implement DragEnter and DragDrop Methodes.
I did it like the online-manuals says. (ok i had to try out something more, because DragDrop doesn’t exists in WPF)
I think all tutorials for drag/drop is only for Windowsforms, nothing for WPF…

Is there a problem with the richtextbox? If i change it to “allowDrop” – nothing happens. The cursor is still a not-allowed-symbol.

Hope someone can help 🙂

Examplecode from tutorials i read:

richTextBox1.AllowDrop = true;

void richTextBox1_DragEnter(object sender, DragEventArgs e)
{
    e.Effect = DragDropEffects.None;

    if (e.Data.GetDataPresent(DataFormats.XXX))
    {
        e.Effect = DragDropEffects.Copy;
    }
}

void richTextBox1_DragDrop(object sender, DragEventArgs e)
{
    //intert in richtextbox ...
    richTextBox1.methodeXY();
}
  • 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-18T19:52:58+00:00Added an answer on May 18, 2026 at 7:52 pm

    I was curious as to why so I had a little play and eventually got it to work. Essentially, I started by binding to the PreviewXXX events like so:

    AllowDrop="True" PreviewDragEnter="RichTextBox_DragEnter" PreviewDragOver="RichTextBox_DragEnter" PreviewDrop="RichTextBox_Drop"
    

    Even still, they STILL didn’t work. But the answer came here, in the form of elevated permissions. I usually run VS2010 with admin elevation. Because I was dropping some files from Explorer onto my RichTextBox, it was essentially banning the operation because Explorer runs in a non-elevated user mode. Running the VS2010 in a non-elevated mode fixed the problem. The article linked does suggest some workarounds, but I haven’t tried them yet.

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

Sidebar

Related Questions

i want to implement a Drag/Drop mechanic in WPF, but it didn't work... With
I want to implement drag and drop between two components within the same JVM.
I'm trying to implement drag/drop/sort between 2 list elements: <ul id=first> <li>item 1</li> <li>item
I want to implement drag&drop possibilities in my application. Here is my source code:
We're trying to implement drag and drop in Silverlight (3). We want users to
I started trying to implement drag-and-drop of virtual files (from a C# 4/WPF app)
I want to use Jquery UI Sortable to implement drag-drop and sortable display. In
How to implement drag & drop for a WPF application? I could open 2
I want to implement an automatic update system for a windows application. Right now
I want to implement a two-pass cache system: The first pass generates a PHP

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.