Hello there everyone. I am trying to capture a screen cap of student work,so teachers can look at it later.
I am trying to basically take a snap shot of the form, put it into a picture box called picture1, then save it.
This is the code I am using.
The thing is, the code works, as it will save the file as a BMP, but the thing is, it just takes a copy of the empty picture box. Is there another way to do this?
Thanks!
I am trying to basically take a snap shot of the form, put it into a picture box called picture1, then save it.
This is the code I am using.
VB Code:
Private Sub PrintButton_Click() Dim s As String 'you can also make the picbox visible=false 'or move it off screen Picture1.AutoRedraw = True s = "Form Picture dated: " & Now Clipboard.Clear DoEvents Call keybd_event(VK_SNAPSHOT, AppScreen, 0&, 0&) DoEvents 'get the form pic to Picture1 Set Picture1.Picture = Clipboard.GetData(vbCFBitmap) 'write the caption With Picture1 Picture1.Height = 9960 Picture1.Width = 15030 End With Picture1.Print s SavePicture Picture1.Image, App.Path & "\Literacy Station Picks - " & LiteracyStationWeekView.Caption & Format(Date, "dd-mm-yyyy") & " - " & Format(Time$, "hh-mm-ss") & ".bmp" End Sub
The thing is, the code works, as it will save the file as a BMP, but the thing is, it just takes a copy of the empty picture box. Is there another way to do this?
Thanks!