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
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