Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

C#

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...