Newsgroup: it.comp.lang.visual-basic
Titolo: stampare il contenuto di un form

ciao, qualcuno sa dirmi se e come č possibile stampare il contenuto di un
form ingrandendo tutto per riempire un foglio A4?
grazie
                                                                Andrea

 form ingrandendo tutto per riempire un foglio A4?
http://makeashorterlink.com/?E19652133


Lupo non funziona, non so perchè ma mi da errore in compilazione
    r = OleCreatePictureIndirect(pic, IID_IDispatch, 1, IPic)
sub o function non definita
oltre a non capire che cosa ncar visto che non è dichiarata, l'ho messa io
come string

Huntercity ha scritto:

ncar è una roba mia, ignorala
Non so quanta roba manchi in quel listato. Pubblico le varie dichiarazioni,
sperando che basti. Mi scoso.
Declare Sub GlobalMemoryStatus Lib "kernel32" (lpBuffer As MEMORYSTATUS)
Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA"
(lpVersionInformation As OSVERSIONINFO) As Long
Declare Function GetDiskFreeSpaceEx Lib "kernel32" Alias
"GetDiskFreeSpaceExA" (ByVal lpRootPathName As String,
lpFreeBytesAvailableToCaller As Currency, lpTotalNumberOfBytes As Currency,
lpTotalNumberOfFreeBytes As Currency) As Long
Declare Function BitBlt Lib "GDI32" (ByVal hDCDest As Long, ByVal XDest As
Long, ByVal YDest As Long, ByVal nWidth As Long, ByVal nHeight As Long,
ByVal hDCSrc As Long, ByVal XSrc As Long, ByVal YSrc As Long, ByVal dwRop As
Long) As Long
Declare Function GetFileVersionInfo Lib "Version.dll" Alias
"GetFileVersionInfoA" (ByVal lptstrFilename As String, ByVal dwhandle As
Long, ByVal dwlen As Long, lpData As Any) As Long
Declare Function GetFileVersionInfoSize Lib "Version.dll" Alias
"GetFileVersionInfoSizeA" (ByVal lptstrFilename As String, lpdwHandle As
Long) As Long
Declare Function VerQueryValue Lib "Version.dll" Alias "VerQueryValueA"
(pBlock As Any, ByVal lpSubBlock As String, lplpBuffer As Any, puLen As
Long) As Long
Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (hpvDest As Any,
hpvSource As Any, ByVal cbCopy As Long)
Declare Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As Any,
ByVal Source As Long, ByVal length As Long)
Declare Function CreateCompatibleBitmap Lib "GDI32" (ByVal hdc As Long,
ByVal nWidth As Long, ByVal nHeight As Long) As Long
Declare Function CreateCompatibleDC Lib "GDI32" (ByVal hdc As Long) As Long
Declare Function CreatePalette Lib "GDI32" (lpLogPalette As LOGPALETTE) As
Long
Declare Function DeleteDC Lib "GDI32" (ByVal hdc As Long) As Long
Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal
dwReserved As Long) As Long
Declare Function GetDC Lib "user32" (ByVal hWND As Long) As Long
Declare Function GetDesktopWindow Lib "user32" () As Long
Declare Function GetDeviceCaps Lib "GDI32" (ByVal hdc As Long, ByVal
iCapabilitiy As Long) As Long
Declare Function GetForegroundWindow Lib "user32" () As Long
Declare Function GetSystemDirectory Lib "kernel32.dll" Alias
"GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As
Long
Declare Function GetSystemPaletteEntries Lib "GDI32" (ByVal hdc As Long,
ByVal wStartIndex As Long, ByVal wNumEntries As Long, lpPaletteEntries As
PALETTEENTRY) As Long
Declare Function GetWindowDC Lib "user32" (ByVal hWND As Long) As Long
Declare Function GetWindowRect Lib "user32" (ByVal hWND As Long, lpRect As
RECT) As Long
Declare Function GetWindowsDirectory Lib "kernel32.dll" Alias
"GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As
Long
Declare Function GlobalAlloc Lib "kernel32" (ByVal wFlags As Long, ByVal
dwBytes As Long) As Long
Declare Function GlobalFree Lib "kernel32" (ByVal hMem As Long) As Long
Declare Function GlobalLock Lib "kernel32" (ByVal hMem As Long) As Long
Declare Function GlobalUnlock Lib "kernel32" (ByVal hMem As Long) As Long
Declare Function OleCreatePictureIndirect Lib "olepro32.dll" (PicDesc As
PicBmp, RefIID As GUID, ByVal fPictureOwnsHandle As Long, IPic As IPicture)
As Long
Declare Function PrintDialog Lib "comdlg32.dll" Alias "PrintDlgA" (pPrintdlg
As PRINTDLG_TYPE) As Long
Declare Function RealizePalette Lib "GDI32" (ByVal hdc As Long) As Long
Declare Function ReleaseDC Lib "user32" (ByVal hWND As Long, ByVal hdc As
Long) As Long
Declare Function SelectObject Lib "GDI32" (ByVal hdc As Long, ByVal hObject
As Long) As Long
Declare Function SelectPalette Lib "GDI32" (ByVal hdc As Long, ByVal
hPalette As Long, ByVal bForceBackground As Long) As Long
Declare Function SendMessageByNum Lib "user32" Alias "SendMessageA" (ByVal
hWND As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As
Long) As Long
Declare Function SetWindowPos Lib "user32" (ByVal hWND As Long, ByVal
hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long,
ByVal cy As Long, ByVal wFlags As Long) As Long
Declare Function waveOutGetNumDevs Lib "winmm" () As Long
Declare Function WinExec Lib "kernel32.dll" (ByVal lpCmdLine As String,
ByVal nCmdShow As Long) As Long


Declare Sub GlobalMemoryStatus Lib "kernel32" (lpBuffer As MEMORYSTATUS)
Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA"
(lpVersionInformation As OSVERSIONINFO) As Long
Declare Function PrintDialog Lib "comdlg32.dll" Alias "PrintDlgA" (pPrintdlg
As PRINTDLG_TYPE) As Long
queste non credo che servano, mi da errori di non definizione di tipo ma
togliendole funziona
ah bisogna mettere un prn.enddoc dentro la funzione di stampa, oppure dopo
la chiamata alla funzione
grazie sempre disponibile
Huntercity
ps: credo che molto della dichiarazioni che hai postato non serva, se ho
tempo ripulisco tutto per bene e poi
posto il codice completo

 posto il codice completo
Sì, per non peccare in difetto, ho postato l'intero blocco, ma _certamente_
un sacco di roba non serve a qui fini.

 form ingrandendo tutto per riempire un foglio A4?
Puoi provare ad usare le routines del progetto StampaFCPB
reperibile a: 
http://www.flanguasco.org
E' prevista la possibilita' di stampare Forms con margini e
dimensioni volute e con tutti i controlli in essi contenuti.
Ciao e se poi ti servisse qualche chiarimento contattami pure.
Franco