|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Releasing resources...PrintPage event multiple times. I am closing all the databases related objects resources when it is not required. Since I am new to the printing part of the application just wanted to make sure what are all the print related object that I should close exclusively to avoid resource bottle neck (just to make sure the that the resources are released). Few objects that I have used in the applications are. Font, SolidBrush, Pen, StringFormat etc.. Thank you, Vb.Net and .Net Framework 1.1. Pete Hi Pete,
I don't believe that you would encounter a resource bottleneck under "normal" conditions and if you are handling the Font and other objects you mentioned, as expected, there is nothing that you need to explicitly dispose of. I assume here that you are using the PrintDocument class to do your printing, and this is a Windows Application. 2 things to note however, 1. If you're reading the text to print, from a FileStream, then close it and any attached StreamReaders. 2. When you finish with printing, set the "e.HasMorePages = False", where e is the PrintPageEventArgs. Happy Printing. Regards, Cerebrus. ================================= Show quoteHide quote "Pete Smith" <PeteSmit***@hotmail.com> wrote in message news:Oqf#6qZMGHA.420@tk2msftngp13.phx.gbl... > > > I have written print application which prints multiple pages by calling > PrintPage event multiple times. > > I am closing all the databases related objects resources when it is not > required. > > Since I am new to the printing part of the application just wanted to make > sure what are all the print related object that I should close exclusively > to avoid resource bottle neck (just to make sure the that the resources are > released). > > Few objects that I have used in the applications are. > > Font, SolidBrush, Pen, StringFormat etc.. > > Thank you, > > Vb.Net and .Net Framework 1.1. > > Pete > > > > Right or Wrong, I use the rule that if an object has a dispose method, then I
dispose of it when I'm thru with it. -- Show quoteHide quoteDennis in Houston "Cerebrus99" wrote: > Hi Pete, > > I don't believe that you would encounter a resource bottleneck under > "normal" conditions and if you are handling > the Font and other objects you mentioned, as expected, there is nothing that > you need to explicitly dispose of. > > I assume here that you are using the PrintDocument class to do your > printing, and this is a Windows Application. > > 2 things to note however, > > 1. If you're reading the text to print, from a FileStream, then close it and > any attached StreamReaders. > > 2. When you finish with printing, set the "e.HasMorePages = False", where e > is the PrintPageEventArgs. > > Happy Printing. > > Regards, > > Cerebrus. > ================================= > "Pete Smith" <PeteSmit***@hotmail.com> wrote in message > news:Oqf#6qZMGHA.420@tk2msftngp13.phx.gbl... > > > > > > I have written print application which prints multiple pages by calling > > PrintPage event multiple times. > > > > I am closing all the databases related objects resources when it is not > > required. > > > > Since I am new to the printing part of the application just wanted to make > > sure what are all the print related object that I should close exclusively > > to avoid resource bottle neck (just to make sure the that the resources > are > > released). > > > > Few objects that I have used in the applications are. > > > > Font, SolidBrush, Pen, StringFormat etc.. > > > > Thank you, > > > > Vb.Net and .Net Framework 1.1. > > > > Pete > > > > > > > > > > >
HttpWebRequest
Using Rich Text Box - make a line bold Beginners problem with multiple forms Combobox and Values - Help Please inheritence Regex help needed Using Word for RTF files creation to use with RichTextBox Defaullt Printer.... Problem Downloading PDF with HTTPWebRequesst add a list item to a bound control? |
|||||||||||||||||||||||