Drag and Drop Formats in WebBrowser Control/MSHTML

C

Charles Law

I'm asking this here as I have already asked in the dedicated newsgroups but
with no answer. I wonder if there is an answer that is more generally
applicable to VB.NET.

I want to be able to drag an HTML element onto the WebBrowser control and
drop it where the mouse is. I have looked at two options:

<code>
Dim obj As New DataObject
Dim el As IHTMLElement
Dim s As String

s = " ... some html ... "

el = document.createElement(html)

'' EITHER:

obj.SetData("Text", el.outerHTML)

'' OR
obj.SetData(el)

DoDragDrop(obj, DragDropEffects.Copy)
</code>

In the first case, the object that is dragged contains text. I can retrieve
it as follows

Dim s As String = evt2.dataTransfer.getData("Text")

In the latter case, how can I retrieve the HTML element? Also, how can I
interrogate the data object to find out what format is contained in it?

I prefer the latter case, if it can be made to work, because the html
element may be quite complex.

Thanks.

Charles
 
C

Cor

Hi Charles,

I have almost the same problem as you. But I am not busy with it now.

You want to drop an element in an underlaying HTML table I asume?

Did you know that in the next version from the framework is planned a totaly
new Webbrowser not a Com.

Are you sure you are not doing now a lot of work, while in future it is a
standard feature.

Just my thought,

Cor
 
C

Charles Law

Hi Cor

I am almost certainly doing a lot more work than I need to ;-) This
WebBrowser control is the bane of my life.

I am actually just trying to drop elements onto the browser, but some of
them have nested tags, so it is much more complicated if I drop HTML text
rather than a preformed element.

Where did you here about the new native NET webbrowser control? I would like
to read about it. Do you know when the next version of the framework is due?

Regards

Charles
 
C

Cor

Hi Charles,

I only did find this, very few, but this was the first time I did look at
whidbey.


http://www.mymsevents.com/MyMSEvent...&catFast+Tracks=0&future=0&submit=Search+Now!

I know probably nothing more about new things than you do, but I saw it
somewhere about webbrowser. Now I did look at the new things from whidbey it
is even possible that someone mixes things up, because it seems that they
start to make the VS.studio design mode for asp.net in a way you can really
use it for a professional desing.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top