G
Guest
Hi group
I am using a 3rd party AX control in a VB.NET application. One of the methods of this control is to capture the current map within the control to the windows clipboard as .WMF. I am automating some precesses for the client and I don't know how to programmatically paste the WMF from the clipboard to another control in the application. The picture box control supports WMF but I don't know how to set its image property to whats in the clipboard
Here is my testing sample so far
<pre
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Clic
Me.AxMGMap1.copyMap() 'copy map to clipboard as WM
Dim iData As IDataObject = Clipboard.GetDataObject(
If iData.GetDataPresent(DataFormats.MetafilePict) Then 'is it WMF
Me.PictureBox1.Image = iData' Invalid Cast Here
Els
' No it is not
MsgBox("Could not retrieve data off the clipboard."
End I
End Su
</pre
iData is of type iDataObject, the picture box expects type Image - how to cast
Any help is appreciated
Scott
I am using a 3rd party AX control in a VB.NET application. One of the methods of this control is to capture the current map within the control to the windows clipboard as .WMF. I am automating some precesses for the client and I don't know how to programmatically paste the WMF from the clipboard to another control in the application. The picture box control supports WMF but I don't know how to set its image property to whats in the clipboard
Here is my testing sample so far
<pre
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Clic
Me.AxMGMap1.copyMap() 'copy map to clipboard as WM
Dim iData As IDataObject = Clipboard.GetDataObject(
If iData.GetDataPresent(DataFormats.MetafilePict) Then 'is it WMF
Me.PictureBox1.Image = iData' Invalid Cast Here
Els
' No it is not
MsgBox("Could not retrieve data off the clipboard."
End I
End Su
</pre
iData is of type iDataObject, the picture box expects type Image - how to cast
Any help is appreciated
Scott