The detail steps are as below:
1.Add .Net Reference for "System.Drawing.dll" and "System.Windows.Forms.dll"
2.Write down the following code:
Dim temp As PictureBox
Set temp = DotNETPictureBox("Name=checkedPictureBox").Object
Dim temp1 As Image
Set temp1 = temp.Image
But when executing the last row code,the error message of "Type mismatch" will be poped up.
Any feedback shall be appreciated.
You are getting the type mismatch because you declared temp1 as 'image' whereas 'temp.Image' returns an object with a different data type.
What is the typename of the object returned by temp.Image?
Run the following on the immediate window to get the correct typename:
If you always do what you've always done, you will always get what you've always got!
I used Typename(temp.image) function,it may return the "BitMap" object.So I modified the code as following:
dim temp1 as BitMap
But error message of "Type Mismatch" was still poped up.