...tried tested and true..
ok..this code will capture your form and save it to a bmp
if you use a titleless form and an image container
with stretch set to true and sizez to fill the form then
you should end up with the image you load into the
image container...
good luck...
Private Declare Sub keybd_event Lib "user32" _
(ByVal bVk As Byte, ByVal bScan As Byte, _
ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Public Function getIt(ByVal theFile As String) As Boolean
Dim lString As String
On Error GoTo Trap
'Check if the File Exist
If Dir(theFile) <> "" Then Exit Function
Call keybd_event(vbKeySnapshot, 0, 0, 0)
SavePicture Clipboard.GetData(vbCFBitmap), theFile
getIt = True
Exit Function
Trap:
'Error handling
MsgBox "Error Occured in fSaveGuiToFile. Error #: " & Err.Number & ", " & Err.Description
End Function
Private Sub Command1_Click()
Call getIt("c:\my documents\its.bmp")
End Sub