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

  • Home
  • SEARCH
  • 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 9121327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:50:13+00:00 2026-06-17T05:50:13+00:00

I know the following question is a bit tricky, but I really need to

  • 0

I know the following question is a bit tricky, but I really need to solve it…

Imagine you have a form with a textbox-control (in my case a RichTextBox) on it.
Now you select a portion of text within this control, start a drag-event and drop the selected text OUTSIDE the form, right to some folder within the windows explorer, as for instance the desktop…

How can this be accomplished? I didn’t found something useful on the net besides the following link: http://forums.asp.net/t/1600192.aspx/1

All i know is that this kind of file-writing operation is called “scrap-file generation”.
Have someone a useful hint for me?

  • 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-06-17T05:50:14+00:00Added an answer on June 17, 2026 at 5:50 am

    The FileDrop expects the files to exist and the drop just does a copy of the file. You will have to write your data out to a file and then pass that name to the DataObject. The below is just a demonstration and you will need to figure out how you write the files and clean everything up so you are not creating extra files on the user’s PC.

    private void richTextBox1_MouseLeave(object sender, EventArgs e)
    {
        // If the left mouse button is down when leaving the rtb
        if (MouseButtons == MouseButtons.Left)
        {
            // Write everything to a temp file.
            System.IO.File.WriteAllText(@"z:\Temp\helloWorld.rtf", richTextBox1.SelectedRtf);
            string[] filenames = { @"z:\Temp\helloWorld.rtf" };
            DataObject obj = new DataObject();
            // Set the drag drop data with the FileDrop format
            obj.SetData(DataFormats.FileDrop, filenames);
            // Start the drag drop effect
            DoDragDrop(obj, DragDropEffects.All);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to really ask this question as I donot know Python. Following are
This is a bit of a complicated question because I don't really know where
I need to solve the following question which i can't get to work by
I know, there are plenty of similar questions, but my question is a bit
Really sorry to be asking a bit of an off topic question, but we've
Let's say I have the following bit of code (which I know could be
Maybe iam a bit confus but .. how do you handle the following case:
Ok bit of a basic question here but I wanted to know what the
I know the question is a bit simplistic, but I feel like I'm missing
I know this question has been around, but I found answers a bit foggy,

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.