• 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

    • Final Fantasy VII Remake Part 3 is getting a simultaneous release across PC and all consoles by Pulasthi Ariyasinghe Square Enix showed up to the Summer Game Fest presentation today with multiple trailers showing off its next chapter in the Final Fantasy VII Remake saga. The final chapter of this trilogy now has an official name too, with it being dubbed Final Fantasy VII Revelation, following up Final Fantasy VII Remake and Final Fantasy VII Rebirth from recent years. Vincent Valentine, Cid, Cloud, Barret, Tifa, and more showed up in the trailers as they battle against enemies, or 'Weapons,' from the final chapter. "As the world teeters on the brink of annihilation, the final battle against Sephiroth begins," says the trailer description. "A meteor mars the sky, monstrous planetary guardians wreak havoc across the globe, and the fires of war rage. Now, Cloud and his companions must stand against this chaos to not only decide the planet's fate, but bring a legendary conflict to its conclusion." Following the reveal trailer, the show also dropped some gameplay footage that shows off a new way to travel across the open world using the Highwind airship. Players will be able to swap characters on during battles, use tactical mode to synchronize with allies, and summon their entities. Cid Highwind and Vincent Valentine are joining the party this time too. “FINAL FANTASY VII, first released in 1997, has been beloved by fans for many years and has since become a “legend” in its own right," added producer Yoshinori Kitase. "The FINAL FANTASY VII Remake Series that began in 2020 with everyone’s passionate support is finally reaching its climactic finale with FINAL FANTASY VII REVELATION. The story’s final destination represents my emotions spanning thirty years working on this title" One of the biggest revelations of this announcement, however, was the multiplatform release confirmation from the get-go. Square Enix will be releasing Final Fantasy VII Revelation across PC, Xbox Series X|S, Nintendo Switch 2, and PlayStation 5 in Spring 2027 without any timed exclusivity programs.
    • Hello, Having a simple utility to allow Microsoft's customers to configure the context menu, with a few options like showing the current menu, showing a proposed menu/alternate configurations, loading and saving the settings, and a "reset to default" option would have solved this. Let Microsoft provide a recommended default look-and-feel, maybe a couple alternative configurations, like a basic/simplified version of that, and a more advanced version for that, and that would have been very well-received, I think. Microsoft could even had offered a library of different configurations, similar to what they have done in the past for Windows Media Player skins, Themes, and desktop wallpaper. Regards, Aryeh Goretsky
    • No Steam release. It's gonna fail on PC. Even an Epic Online engineer said that people go there for the free stuff and then immediately go back to Steam.
    • Nice. Admittedly, his other games never interested me, but this seems pretty cool.
    • It's time to say goodbye to Edge and switch back to Firefox. There's no way to disable the ugly rounded corners that appear everywhere. Not even on the page frame. No one uses screens with rounded corners, you idiots.
  • 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
      482
    2. 2
      PsYcHoKiLLa
      269
    3. 3
      Skyfrog
      78
    4. 4
      Steven P.
      68
    5. 5
      +Edouard
      61
  • Tell a friend

    Love Neowin? Tell a friend!