Postada em 23/03/2006 08:26 hs
Eu tenho um Custom Control que faz uma label ficar em anglo e este Custom esta dentro de uma picture. quando eu mando imprimir a picture simplesmente nao aparece nada.
Segue abaixo o codigo da impressao e o controle ja esta dentro da picture:
Private Const twipFactor = 1440 Private Const WM_PAINT = &HF Private Const WM_PRINT = &H317 Private Const PRF_CLIENT = &H4& ' Draw the window's client area. Private Const PRF_CHILDREN = &H10& ' Draw all visible child windows. Private Const PRF_OWNED = &H20& ' Draw all owned windows.
Private Declare Function SendMessage Lib "user32" Alias _ "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _ ByVal wParam As Long, ByVal lParam As Long) As Long
Private Sub Command2_Click() LabelAngle1.ZOrder 1 Picture1.SetFocus Picture2.AutoRedraw = True
rv = SendMessage(Picture1.hwnd, WM_PAINT, Picture2.hdc, 0) rv = SendMessage(Picture1.hwnd, WM_PRINT, Picture2.hdc, _ PRF_CHILDREN + PRF_CLIENT + PRF_OWNED)
Picture2.Picture = Picture2.Image
Picture2.AutoRedraw = False
Printer.Print Printer.PaintPicture Picture2.Image, Picture1.Left, Picture1.Top, Picture1.Width, Picture1.Height Printer.EndDoc End Sub
O que sera que pode ser? O controle esta dentro da Picture1
Rodrigo
|