aewarnick Posted April 21, 2003 Posted April 21, 2003 After I posted this I noticed that was missing from my code in this post. I guess must be some kind of code this web page uses. But, where you see a blank spot just put in there in your mind. private void PrintMenuItem_Click(object sender, System.EventArgs e) { this.pageSetupDialog.ShowDialog(); DialogResult r= this.printDialog.ShowDialog(); if(r==DialogResult.OK) { DialogResult R= this.PrintPre.ShowDialog(); if(R==DialogResult.OK) this.printDocument.Print(); } } //-------------------------------------------------------------- int =0; private void printDocument_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { int charsFilled=0, linesFilled=0; string text= this.RTB.Text.Substring( , RTB.Text.Length- ); e.Graphics.MeasureString(text, this.RTB.Font, new SizeF(e.MarginBounds.Width, e.MarginBounds.Height), new StringFormat(StringFormatFlags.LineLimit), out charsFilled, out linesFilled); e.Graphics.DrawString(text, this.RTB.Font, Brushes.Red, e.MarginBounds, new StringFormat(StringFormatFlags.LineLimit) ); = +charsFilled; if( < this.RTB.Text.Length) { ++ ; e.HasMorePages=true; } else {e.HasMorePages=false; =0;} } This is a very simple text printing code but when I get to the page setup dialog where I can adjust the margins and press print I get a fatal error for some reason on win98 but it prints perfecly on xp pro and I cannot see any reason why. Does anyone know what may be the cause? Quote C#
*Gurus* Derek Stone Posted April 21, 2003 *Gurus* Posted April 21, 2003 This is a known issue. Consult the Microsoft support site. Quote Posting Guidelines
*Gurus* Derek Stone Posted April 21, 2003 *Gurus* Posted April 21, 2003 The fix: Dim pdDocument As PrintDocument = New PrintDocument() [b]pdDocument.PrintController = New StandardPrintController()[/b] pdDocument.Print() Quote Posting Guidelines
aewarnick Posted April 21, 2003 Author Posted April 21, 2003 Do you think they will upgrade the framework to fix it? Quote C#
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.