• 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

    • This saddens me greatly
    • Well again I do not mind seeing it charge my stuff if it does it well. "yeah charge my phone like that, charge it good"
    • Getting so tired of this push for that new useless slop over the less-useless old slop that at this point I just want M$ to have this nice, big, hearty cup of *FU*.
    • Brave Browser 1.91.168 by Razvan Serea Brave Browser is a lightning-fast, secure web browser that stands out from the competition with its focus on privacy, security, and speed. With features like HTTPS Everywhere and built-in tracker blocking, Brave keeps your online activities safe from prying eyes. Brave is one of the safest browsers on the market today. It blocks third-party data storage. It protects from browser fingerprinting. And it does all this by default. Speed - Brave is built on Chromium, the same technology that powers Google Chrome, and is optimized for speed, providing a fast and responsive browsing experience. Brave Browser also features Brave Rewards, a system that rewards users with Basic Attention Tokens (BAT) for viewing opt-in ads. This innovative system provides an alternative revenue model for content creators and a way to support the Brave community. SlimBrave Neo takes all the good things about Brave and makes them even better by keeping everything clean, light, and privacy-focused. It removes the extra clutter, turns off features you might not need, and cuts down on anything that could slow you down or collect unnecessary data. Because it relies on simple settings and policies instead of modifying the browser itself, you still get full Brave compatibility—just in a smoother, lighter, and more privacy-friendly package. Brave Browser 1.91.168 changelog: Web3 Added “Get Started” section to the “Portfolio” page. (#54029) Added the ability to view “Asset Distribution” in “Portfolio”. (#54028) Added dotted texture to wallet line chart. (#54216) Migrated Jupiter swap provider to “Gate3”. (#51848) Updated the “Permission” panel to display the site origin. (#54482) Updated NFT balance fetch to remove duplicate entries prior to fetching balances. (#55036) Fixed missing back button on the “Deposit Funds” page. (#55842) Fixed reloading an account tab redirecting to the “Accounts” page. (#54826) Leo Added support for text file uploads with renderer-based extraction. (#54062) Added PDF text extraction at upload time. (#51911) Updated display of Brave Leo attachment previews to scroll horizontally instead of vertically. (#54258) Updated the “Copy” button for the code block header to be sticky when scrolling. (#53704) Updated the staged content in the Leo side panel to be the active tab. (#53533) Updated the search terms in the answer’s footer to be left aligned. (#54204) Fixed crash which could occur in certain cases when using multiple tool requests. (#55438) General Added support for Brave Origin. (#37127) [Security] Added the ability to disable or delay automatic extension updates when brave://flags/#brave-user-extension-auto-update is enabled. (#7200) Enabled ability to force context menu using “Shift + Right Click” by default. (#54790) Improved performance by caching adblock DATs. (#27161) Updated background color for PWA install button in the omnibox. (#54736) Fixed tab hover card position when using vertical tabs. (#54199) Fixed extra border displaying around the content area when vertical tabs are used on macOS. (#54153 & #52961) Fixed audio farbling distortion in multi-voice Web Audio API synthesized music. (#52906) Upgraded Chromium to 149.0.7827.54. (#55943) Download: Brave Browser 64-bit | 1.2 MB (Freeware) Download: Brave Browser 32-bit View: Brave Homepage | Offline Installers | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Thanks Microsoft but no, I find both iterations of Outlook terrible nowadays and switched back to Thunderbird at home.
  • Recent Achievements

    • 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
    • Week One Done
      Dr Jared Dental Studio earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      471
    2. 2
      PsYcHoKiLLa
      255
    3. 3
      Skyfrog
      80
    4. 4
      FloatingFatMan
      62
    5. 5
      Michael Scrip
      62
  • Tell a friend

    Love Neowin? Tell a friend!