🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.csharpbuilder.language.csharp
Article #292

Trouble converting code from Delphi to C#

#292
From: Dale Williams
Date: Tue, 17 Jan 2006 21:16
34 lines
2014 bytes
Everyone:

I'm having trouble converting the following printing code from Delphi to 
C#.  The code takes a couple of fields and prints them on a label. 
Here's the code:

	Printer.Orientation := poLandscape;

	If Not Printer.Printing Then
	begin
		Printer.BeginDoc;
	  {Print part num}
		Printer.Canvas.Font.Name := 'Arial';
		Printer.Canvas.Font.Size := 10;
		Printer.Canvas.Font.Style := [fsBold];
		Printer.Canvas.TextOut(3, 30, 'Part: '+'1234567890123456789012645');
	  {Print lot}
		Printer.Canvas.Font.Style := [];
		Printer.Canvas.TextOut(3, 80, 'Lot: '+'01');
	  {Print Qty}
         Printer.Canvas.TextOut(3, 120, 'Qty: '+'100');
	  {Print date}
		Printer.Canvas.Font.Style := [];
		Printer.Canvas.TextOut(475, 30, 'Scrap Date:');
		Printer.Canvas.TextOut(465, 70, SysDate);
		Printer.EndDoc;
	end;
	Printer.PrinterIndex := DefaultPrinter;

Obviously I don't except anyone to rewrite the code but it you can point 
me in the proper direction, that would be a great help.

Sincerely,
Dale Williams
Technical Details
Message-ID: <43cd5e11$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.moat.net!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,871854c3e1c75cc1,start
X-Google-Attributes: gid1efe35,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Tue, 17 Jan 2006 16:16:33 -0500
From: Dale Williams <dwilliams@yf.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.11) Gecko/20050728
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.csharpbuilder.language.csharp
Subject: Trouble converting code from Delphi to C#
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 72.43.20.144
Message-ID: <43cd5e11$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1137532433 72.43.20.144 (17 Jan 2006 13:13:53 -0700)
Lines: 34
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.moat.net!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail