I'm using a PictureBox within my Form to save and email the Form.
PictureBox is set to: Autoredraw = True
1st. Question: Does the Picturebox need to be the same size as the Form if it's set to Autoredraw?
2nd. On the First initial save and email, it only shows a small icon and not the Form, BUT when I send it again it works fine and saves the Form and Emails it.
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Const KEYEVENTF_KEYUP = &H2
Private Function SaveFormPic() As Picture
Dim pic As StdPicture
Command1.Visible = False
Command2.Visible = False
Command3.Visible = False
Command4.Visible = False
Command5.Visible = False
Set pic = Clipboard.GetData(vbCFBitmap)
keybd_event vbKeyMenu, 0, 0, 0
keybd_event vbKeySnapshot, 0, 0, 0
DoEvents
keybd_event vbKeySnapshot, 0, KEYEVENTF_KEYUP, 0
keybd_event vbKeyMenu, 0, KEYEVENTF_KEYUP, 0
DoEvents
Set SaveFormPic = Clipboard.GetData(vbCFBitmap)
Clipboard.SetData pic, vbCFBitmap
End Function
PictureBox is set to: Autoredraw = True
1st. Question: Does the Picturebox need to be the same size as the Form if it's set to Autoredraw?
2nd. On the First initial save and email, it only shows a small icon and not the Form, BUT when I send it again it works fine and saves the Form and Emails it.
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Const KEYEVENTF_KEYUP = &H2
Private Function SaveFormPic() As Picture
Dim pic As StdPicture
Command1.Visible = False
Command2.Visible = False
Command3.Visible = False
Command4.Visible = False
Command5.Visible = False
Set pic = Clipboard.GetData(vbCFBitmap)
keybd_event vbKeyMenu, 0, 0, 0
keybd_event vbKeySnapshot, 0, 0, 0
DoEvents
keybd_event vbKeySnapshot, 0, KEYEVENTF_KEYUP, 0
keybd_event vbKeyMenu, 0, KEYEVENTF_KEYUP, 0
DoEvents
Set SaveFormPic = Clipboard.GetData(vbCFBitmap)
Clipboard.SetData pic, vbCFBitmap
End Function