help with textbox printing location
I am trying to print the contents of a textbox to location 50, 100 on a sheet of paper the code I have is:
e.Graphics.DrawString(stringForPage, PrintFont, Brushes.Black, rectDraw, strFormat)
I tried to add the coordinates into the code as below:
e.Graphics.DrawString(stringForPage, PrintFont, Brushes.Black, rectDraw, strFormat, 50, 100)
but when I do this I get this message with a blue squigglly line under the code:
overload resolution failed because no accessible 'drawstring' accepts this number of arguments.
If you look at the 6 overloads (different ways of calling) Drawstring, none asks for both a Rectangle and position, which makes sense. Since the rectangle already has a X,Y coordinate, you do not need to specify them again. There is also the possibility that the coordinate of the rectangle would be in conflict with the one defined by the last 2 parameters.
If you do not need the bounding rectangle, simply call like this:
e.Graphics.DrawString(stringForPage, PrintFont, Brushes.Black, 50, 100, strFormat)
By zhixuen in forum ASP.NET
Last Post: 02-10-2009, 05:09 AM
By saquib189 in forum ASP.NET
Last Post: 09-19-2008, 02:57 PM
Last Post: 01-15-2006, 08:10 PM
By Larry Rebich in forum .NET
Last Post: 08-03-2002, 04:19 PM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL