• 0

[vb .net 2.0]RichTextBox Drag & Drop from explorer


Question

Ok, I have a slight issue and for some reason I am not able to resolve it. I have a parent form with a drag and drop event to open files dragged from explorer into a new child form, it works fine. I also have children forms with a rich text box (txtMain) filling the entire form. I took the very same code from the main form and just put it into the drag and drop events for txtMain. It works as well, the new child form is opened and its txtMain is filled with the information from the text file. It works fine, with one exception, it leaves a boxed link with the text "Text File" in the txtMain into which the file was originally dragged. How can I prevent it from doing this while still doing every thing else?

This problem only happens in 2.0 and not 1.1. I'm guessing the rich text box control was altered a bit.

21 answers to this question

Recommended Posts

  • 0
Ok, I have a slight issue and for some reason I am not able to resolve it. I have a parent form with a drag and drop event to open files dragged from explorer into a new child form, it works fine. I also have children forms with a rich text box (txtMain) filling the entire form. I took the very same code from the main form and just put it into the drag and drop events for txtMain. It works as well, the new child form is opened and its txtMain is filled with the information from the text file. It works fine,  with one exception, it leaves a boxed link with the text "Text File" in the txtMain into which the file was originally dragged. How can I prevent it from doing this while still doing every thing else?

This problem only happens in 2.0 and not 1.1. I'm guessing the rich text box control was altered a bit.

584867028[/snapback]

If you think it's a bug, submit it here http://lab.msdn.microsoft.com/productfeedback/Default.aspx

They'll reply back to you if it's By Design or if they've fixed it. Also, have you downloaded the newest drop (October)?

  • 0

No, I haven't downloaded the newest. You have al ink?

Also, it doesn't seem to be a bug, just an enhanced functionality that needs to be worked around or something because if you doble click the box, it opens the file as though you double clicked it in explorer.

  • 0
I found and tried installed the refresh, but everytime I do, it just crashes with one of those "send error report" errors.

584870000[/snapback]

Did you follow the installation instructions (uninstalling this and that) before trying to install it?

  • 0
Did you follow the installation instructions (uninstalling this and that) before trying to install it?

584870601[/snapback]

Where are those?

Are you mousing over the top standard toolbar in VS 2005? It crashes when you do.

584870661[/snapback]

In BETA 1? Doesn't happen for me.

  • 0

You can download the software here:

http://lab.msdn.microsoft.com/vs2005/downloads/default.aspx

And you can view the readme here:

http://lab.msdn.microsoft.com/express/read...04/default.aspx

Unfortuantly, the October drop isn't as stable as other drops. They just wanted to refresh a few features (like Edit & Continue for C#!). December should roll out a really nice release.

  • 0
Nah, the one that came out in Oct. Technical Preview Release. Is that the one your using? It crashes alot.

584871610[/snapback]

well I installed and it doesn't crash but it also gives me an error when trying to open a form in designer mode, can only view the code.

  • 0

thats actually a known bug.. I can recall reading about it on the Visual Studio Express blog site. they have no fix for it and they say it has to do with previous version of the 2.0 framework being installed. They said there is no resolve for it but they do know its there. Also can you post a pic of the mess

  • 0

why not have it so that it drags into the MDI parent window and then opens up an instance of the txtMain... Or is that what you are already doing ? didn;t sound to clear. Sounds like your dragging the txt files onto the richtextbox and they open up and then your dragging that info from one box to the other child window. correct ?

  • 0
why not have it so that it drags into the MDI parent window and then opens up an instance of the txtMain... Or is that what you are already doing ? didn;t sound to clear. Sounds like your dragging the txt files onto the richtextbox and they open up and then your dragging that info from one box to the other child window. correct ?

584872829[/snapback]

Well, if the child form is maximized, I want it to be able to still detect the drag and drop. So I have drag and drop on for both the richtextbox in the child form and the mdi parent.

How are you reading the text files? streamreader?

Should try streamreading on drag and drop.

584873756[/snapback]

yes, using a streamreader.

  • 0

Due to the crappy documentation, I'm not able to find a definitive answer, but I saw that you posted on the newsgroup.

I suspect that the CreateRichEditOleCallback has something to do with it always linking/embedding the file into the control. If you create your own custom RichEdit contro(via inheritance)l and override that method, you'll have to create your own drag-n-drop code as all d-n-d events won't be raised(according to what little docs there are).

  • 0
oh man that's just a bitch and a half

584875379[/snapback]

There might be a work around. It may involve SendMessage. :)

If you look at wordpad, which uses the RichText control, you'll see the same behavior. It could be that this control isn't near being finished. I would think that MS will provide a way to cancel an OLE event if you handle the DragDrop event.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Studio MDHR reveals Cuphead sequel and an 8-bit platformer spin-off by Pulasthi Ariyasinghe Studio MDHR has been rather silent about its next major gaming project since the release of Cuphead back in 2017. However, that ended today during the Summer Game Fest presentation, with the studio revealing not one but two project announcements. First, the studio confirmed that it is currently in the middle of developing a brand-new Cuphead game, bringing back the iconic characters for another adventure. Just like the last game, this is slated to be a fully hand-animated endeavor. This also means there isn't a release date attached to it yet. “Craftsmanship is at the heart of everything we do here at Studio MDHR,” says co-founder Chad Moldenhauer. “When it came time to peel back the curtain and share a little bit about what we’ve been up to, we couldn’t imagine a more fun way to do so than with today’s Special Bulletin. The studio is working on this new Cuphead with help from Toronto’s Stop Motion Department and Continue Agency. At the same time, Studio MDHR also revealed that another part of the team has been working on a different Cuphead installment. Dubbed the Mighty Cuphead Adventure, this is taking a different art direction to the original. "In true Studio MDHR fashion, this game goes beyond just taking inspiration from the classics of the 1980s… it is actually built with technology of the era," the studio explained. "That's right: Mighty Cuphead Adventure is programmed in assembly language and designed with the exacting specifications of the Sega Master System home gaming console in mind." Aside from releasing on PC and modern consoles, Mighty Cuphead Adventure will even be playable on the 1985-released Sega Master System. A release date has not been announced just yet.
    • Any decent ITSM will A) have a web form that allows a user to raise a ticket, if you're writing an email you can write a ticket. B) Monitor a mailbox and auto-generate tickets based on inbound mails for those users that really can't get their heads around the concept that if you have an issue you go to support.mycompany.com and fill in the box. From your description you're having users email the desk, and then having a human read each one and manually raise a ticket on behalf of the user.
    • Microsoft PC Manager 3.21.6.0 (Offline Installer) by Razvan Serea With Microsoft PC Manager, users can easily perform basic computer maintenance and enhance the speed of their devices with just one click. This app offers a range of features, including disk cleanup, startup app management, virus scanning, Windows Update checks, process monitoring, and storage management. Microsoft PC Manager key features: Storage Manager- easily uninstall infrequently used apps, manage large files, perform a cleanup, and set up Storage Sense to automatically clear temporary files. Health Checkup feature -scans for potential problems, viruses, and startup programs to turn off. It helps you identify unnecessary items to remove, optimizing your system's performance. Pop-up Management - block pop-up windows from appearing in apps. Windows Update - scans your system for any pending updates. Startup Apps - enable or disable startup apps on your PC, allowing you to optimize your system's startup performance. Browser Protection - rest assured that harmful programs cannot alter your default browser. Also enables you to change your default browser. Process Management - allows you to conveniently terminate any active process, ensuring optimal system performance and resource utilization. Anti-virus protection - Fully integrated with Windows Security. Safeguard your PC anytime. Quick Steps: Download Microsoft PC Manager Offline Installer (APPX/MSIX) with Adguard Adguard serves as a third-party online service, offering a user-friendly method for directly downloading appx, appxbundle, and msixbundle files from the Microsoft Store. Official download links will be generated for both the app's various versions and its dependency packages. How to download Microsoft PC Manager Offline Installer (APPX/MSIX) 1. Initially, you must find the app URL within the Microsoft Store. Access the Microsoft Store via your browser and search for "Microsoft PC Manager". Once located, copy the app URL, which includes the product ID, either from the address bar or from the provided link below. https://apps.microsoft.com/detail/9PM860492SZD 2. Now paste the app URL into the designated area, then click the check mark button to produce a direct download link. 3. To download, right-click the relevant link and select “Save link as…” from your browser's menu. Occasionally, Microsoft Edge may flag the download as insecure. In such cases, consider utilizing alternative browsers such as Google Chrome or Firefox to successfully complete the download. Microsoft PC Manager is a completely free tool optimized exclusively for use on Windows 10 (19042.0 and above) and Windows 11. Download: Microsoft PC Manager 3.21.6.0 | from Microsoft Store View: Microsoft PC Manager Home Page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • I've never even heard of this browser before seeing this article. How does it differ from other browsers?
    • Fixing things? Have you ever tried linux? Everything works out of the box nowadays in most common hardware. This includes Wifi and Bluetooth. If anything, if they return back to windows is because they haven't found an equivalent program which often used on windows.
  • Recent Achievements

    • Mentor
      grik went up a rank
      Mentor
    • Dedicated
      JKR earned a badge
      Dedicated
    • One Year In
      CHUNWEI earned a badge
      One Year In
    • Conversation Starter
      FBSPL earned a badge
      Conversation Starter
    • Week One Done
      I2D earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      485
    2. 2
      PsYcHoKiLLa
      272
    3. 3
      Skyfrog
      78
    4. 4
      Steven P.
      65
    5. 5
      FloatingFatMan
      61
  • Tell a friend

    Love Neowin? Tell a friend!