• 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

    • BATorrent 3.0.2 by Razvan Serea BATorrent is a lightweight, open-source BitTorrent client built with modern C++ and Qt 6, offering a clean, fast, and privacy-focused alternative to traditional torrent apps. It supports magnet links, .torrent files, resume data, sequential downloading, per-file priorities, and even imports from qBittorrent. Power users benefit from integrated RSS auto-download with regex filtering, duplicate detection, and automatic tracker lists from Stremio. Streaming is seamless thanks to auto-detected players like VLC and IINA. BATorrent includes robust VPN tools—interface binding, auto-detection for WireGuard-based services like Mullvad and NordLynx, kill switch, proxy support, and IP filtering. A full WebUI enables remote control, while integrations with Plex, Jellyfin, and Emby automate library updates. With themes, speed scheduling, system-tray alerts, and cross-platform support for Windows, Linux, and macOS, BATorrent delivers a polished, high-performance torrenting experience. BATorrent features: Core .torrent file and magnet link support Resume data — picks up where you left off after restart Import torrents from qBittorrent Create .torrent files from any file or folder Sequential download mode Per-file priority control (skip, low, normal, high) Seed ratio limits with auto-pause DHT, PEX, UPnP, NAT-PMP RSS Auto-Download Subscribe to RSS feeds — automatically download new torrents as they appear Regex filters — match only what you want (e.g. 1080p|720p, S01E\d+) Per-feed settings — custom save path, check interval (5–1440 min), enable/disable Auto-download — matched items are downloaded automatically in the background Supports magnet links, .torrent URLs, and tags Tray notifications when items are auto-downloaded Duplicate detection — never downloads the same item twice Stremio Stremio Addon System pre-installed — works out of the box Auto tracker list from ngosang/trackerslist Streaming Play while downloading — stream video files before the download is complete Supports mp4, mkv, avi, mov, wmv, flv, webm, m4v, ts Auto-detects installed players (VLC, IINA, system default) VPN & Privacy Interface binding — lock torrent traffic to a specific network interface (e.g. tun0) Auto VPN detection — identifies VPN interfaces (tun, tap, WireGuard, Mullvad, NordLynx, ProtonVPN) Kill switch — automatically pauses all torrents if the VPN interface drops Auto-resume — resumes only the torrents paused by the kill switch when VPN reconnects Proxy support — SOCKS5 and HTTP proxy with optional authentication IP filtering — load P2P blocklists to block unwanted IP ranges Protocol encryption (enabled / forced / disabled) WebUI Remote management — control torrents from any browser at http://localhost:8080 REST API with JSON responses Add torrents via magnet link or .torrent upload Pause, resume, remove torrents remotely View peers and files per torrent Dark theme matching the desktop app HTTP Basic Auth with SHA-256 password hashing Configurable port and remote access (localhost vs 0.0.0.0) Interface 3 themes: Dark, Light, Midnight (bat/vampire aesthetic) Real-time speed graph Detailed panel with tabs: General, Peers, Files, Trackers Filter bar: search by name, filter by state (Active, Downloading, Seeding, Paused, Finished) Drag & drop .torrent files and magnet links Drag & drop reorder in torrent list System tray with notifications (download complete, kill switch events, RSS auto-downloads) Splash screen with bat animation Bilingual: English and Portuguese (BR), auto-detected from system locale Bandwidth Scheduler Alternative speed limits — set different download/upload limits on a schedule Time range — configure active hours (e.g. 01:00 to 07:00), supports overnight ranges Per-day control — choose which days of the week the schedule applies Automatically switches between normal and alternative speeds Media Server Integration Plex — automatically trigger library scan when a download completes Jellyfin / Emby — same automatic library refresh via API Configure server URL and authentication token/key in Settings System Cross-platform: Windows, Linux, macOS Auto-shutdown — automatically shut down PC when all downloads complete (60s cancellable countdown) Auto-update system (AppImage on Linux, installer on Windows, DMG on macOS) CLI arguments: pass .torrent files or magnet: URIs directly Keyboard shortcuts: Space to toggle pause, Ctrl+A to select all, Ctrl+O to open BATorrent 3.0.2 changelog: Phone pairing & WebUI The browser WebUI was reskinned to match the desktop app — same dark palette, Inter font, flat surfaces, the real BATorrent logo (it was a random bat before), and a proper magnet icon. It now looks like the same product, not a separate dashboard. Pairing is one tap and zero typing: the generated WebUI password is now copyable, and the QR code carries the credentials — scanning it from your phone logs straight in (no typing the IP or password), then drops the credentials from the address bar. Search Two new providers: RuTor (CIS sources, no login, via a public TorAPI relay) and Torrents-CSV. Results are sorted by seeders (healthiest first), and each search now times out after 15 s so one dead provider can't hang the UI. Files & trackers Per-file priority is back: right-click a file in the detail panel to set Skip / Low / Normal / High. Rename an individual file inside a torrent (double-click or the file menu), separate from renaming the torrent. Remove a tracker from a torrent (the ✕ on a tracker row); adding was already there. Smart Paste on Ctrl+V — paste a magnet, a 40-char info-hash, or a .torrent URL straight from the clipboard and it's added immediately (text fields still paste text normally). Covers & titles Anime fansub naming ([Group] Title - NN) now resolves to the right show. Audio channel layouts in titles (DDP5.1, 7.1, …) are stripped so they don't pollute cover matching. Under the hood The legacy QWidget interface is gone. QML had been the only UI since 3.0.0 (reachable old code lived behind a hidden --legacy flag); with parity confirmed, the entire QWidget layer — main window, every dialog, the theme manager — was removed (~13,400 lines). The four restored actions above were features that backend already supported but the QML port had never wired. macOS: the WebUI password hash moved out of the keychain into app settings, so launching the app no longer pops a login-keychain password prompt on unsigned builds. The actual password still lives in the keychain. Cleanup: ~400 orphaned translation strings and a batch of dead code removed; internal duplication collapsed; an ARCHITECTURE.md added for contributors. Unit / security / memory tests and the ASan/UBSan/TSan sanitizers stay green. Download: BATorrent 3.0.2 | 30.5 MB (Open Source) Download: BATorrent Portable | 42.3 MB Links: BATorrent Website | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • How about a global switch to turn the awful things off instead of a registry hack? Then everyone wins.
    • This doesn't strike me as so shocking when... " IT admins do have some control over this rollout. If they choose to opt out, devices in their tenant won't automatically get the dreaded Copilot app"
  • 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
      468
    2. 2
      PsYcHoKiLLa
      257
    3. 3
      Skyfrog
      79
    4. 4
      ATLien_0
      60
    5. 5
      FloatingFatMan
      60
  • Tell a friend

    Love Neowin? Tell a friend!