• 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

    • expected when they force you by having to use TPM and secure boot for anti cheat crap, and lazy developers only test on windows 11.
    • The fact I need to use "Show more" like 99% of the time is so annoying. Or why I have 7-zip under 3 submenus when it could be in top. And Microslop keeps saying how they'll improve Start and I've not seen ANY improvement yet. In MONTHS. WTF?! I'll believe any of it when they actually deliver anything.
    • LosslessCut 3.69 by Razvan Serea LosslessCut aims to be the ultimate cross platform FFmpeg GUI for extremely fast and lossless operations on video, audio, subtitle and other related media files. The main feature is lossless trimming and cutting of video and audio files, which is great for saving space by rough-cutting your large video files taken from a video camera, GoPro, drone, etc. It lets you quickly extract the good parts from your videos and discard many gigabytes of data without doing a slow re-encode and thereby losing quality. Or you can add a music or subtitle track to your video without needing to encode. Everything is extremely fast because it does an almost direct data copy, fueled by the awesome FFmpeg which does all the grunt work. Features Lossless cutting of most video and audio formats Losslessly cut out parts of video/audio (for cutting away commercials etc.) Losslessly rearrange the order of video/audio segments Lossless merge/concatenation of arbitrary files (with identical codecs parameters, e.g. from the same camera) Lossless stream editing: Combine arbitrary tracks from multiple files (ex. add music or subtitle track to a video file) Losslessly extract all tracks from a file (extract video, audio, subtitle, attachments and other tracks from one file into separate files) Batch view for fast multi-file workflow Remux into any compatible output format Take full-resolution snapshots from videos in JPEG/PNG format Manual input of cutpoint times Apply a per-file timecode offset (and auto load timecode from file) Change rotation/orientation metadata in videos View technical data about all streams Timeline zoom and frame/keyframe jumping for accurate cutting around keyframes Saves per project cut segments to project file View FFmpeg last command log so you can modify and re-run recent commands on the command line Undo/redo Give labels to cut segments View segment details, export/import cut segments as CSV Import segments from: MP4/MKV chapters, Text file, YouTube, CSV, CUE, XML (DaVinci, Final Cut Pro) Video thumbnails and audio waveform Edit file metadata and per-stream metadata Edit per-stream disposition Cut with chapter marks Annotate segments with tags View subtitles Example lossless use cases Cut out commercials from a recorded TV show (and re-format from TS to MP4) Remove audio tracks from a file Extract music track from a video and cut it to your needs Add music to a video (or replace existing audio track) Combine audio and video tracks from separate recordings Include an external subtitle into a video Quickly change a H264/H265 MKV video to MOV or MP4 for playback on iPhone Import a list of cut times from other tool as a EDL (edit decision list, CSV) and run these cuts with LosslessCut Export a list of cut times as a CSV EDL and process these in another tool Quickly cut a file by its MP4/MKV chapters Quickly cut a YouTube video by its chapters (or music times from a comment) Change the language of a file's audio/subtitle tracks Attach cover art to videos Change author, title, GPS position, recording time of a video Fix rotation of a video that has the wrong orientation flag set Great for rotating phone videos that come out the wrong way without actually re-encoding the video. Loop a video / audio clip X times quickly without re-encoding LosslessCut 3.69.0 changelog: Add lossless cropping & aspect ratio override via bitstream and container metadata #643 Alow shifting tracks for each file (-itsoffset) #216 Add "decimate video" tool to filter away all non-keyframes #2111 Add Windows ARM 64 native build with native ffmpeg Move timecode out of timeline and make it copy-able #2592 #2691 #2800 #483 #2808 Upgrade Electron to latest Add new "opposing" align mode #2654 Add FFmpeg -hwaccel auto setting for hardware acceleration of certain operations Add API events export-start and export-complete Allow deleting track metadata #2819 Improve shift segments dialog #2839 Show keyboard shortcuts inside button tooltips in UI Warn if trying to cut with too few keyframes around cutpoint #516 #2780 #2756 (Linux) include app name in notification #2794 Pull latest translations Other notable changes: Advanced output directory selector #2101 #2115 #2755 increase max file name length to 250 (truncation) #2779 don't reset playback speed when using special playback modes #2889 preserve chapters when merging files that already have chapters don't merge adjacent segments in combineOverlappingSegments #2896 don't transfer segment name when filling gaps #2754 always scroll up to zoom in #2703 #2786 increase max keyframes to 10000 Don't bind ctrl/cmd+c by default (they interfer with copying text) Many other improvements and fixes Download: LosslessCut 3.69.0 | ARM64 | ~100.0 MB (Open Source) Links: LosslessCut Website | Other Operating Systems | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Doesn't even need a UI for point 2 - use some sort of JSON/XML container - because MOST users won't even bother.
  • Recent Achievements

    • Conversation Starter
      FBSPL earned a badge
      Conversation Starter
    • Week One Done
      I2D earned a badge
      Week One Done
    • Week One Done
      Dr Jared Dental Studio earned a badge
      Week One Done
    • Week One Done
      RG INVESTMENT GROUP earned a badge
      Week One Done
    • Very Popular
      The Norwegian Drone Pilot earned a badge
      Very Popular
  • Popular Contributors

    1. 1
      +primortal
      488
    2. 2
      PsYcHoKiLLa
      263
    3. 3
      Skyfrog
      85
    4. 4
      FloatingFatMan
      64
    5. 5
      Michael Scrip
      62
  • Tell a friend

    Love Neowin? Tell a friend!