Print in VB.NET

lunedì 12 dicembre 2005 - 17.28

deejay Profilo | Newbie

I must print in a printer with a apecial page setting, I try this code :

Dim dlgSetting As New PrintDialog
dlgSetting.Document = prnStampa
dlgSetting.PrinterSettings.DefaultPageSettings.PaperSize.Height = 400
dlgSetting.PrinterSettings.DefaultPageSettings.PaperSize.Width = 865

but I receive this error :

"An unhandled exception of type 'System.ArgumentException' occurred in system.drawing.dll
Additional information: Cannot change a PaperSize unless its Kind is Custom."

some ideas ??

Thanks

Nicola De Vita

deejay Profilo | Newbie

Potete rispondere anche in Italiano :D

Grazie

totti240282 Profilo | Guru

cosa non hai capito ???

C'è solo un capitano !!!!!!

Brainkiller Profilo | Guru

>"An unhandled exception of type 'System.ArgumentException' occurred
>in system.drawing.dll
>Additional information: Cannot change a PaperSize unless its
> Kind is Custom."

Evidentemente devi assegna a PaperSize la costante Custom.
In questo modo segnali che la tua pagina sarà personalizzata.
A quel punto puoi impostare le dimensioni (altezza e larghezza).
Verifica sul Framwork alla voce PaperSize
ciao

David De Giacomi
Microsoft MVP
http://blogs.dotnethell.it/david/
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5