DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2004
    Posts
    43

    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.

  2. #2
    Join Date
    Feb 2004
    Location
    Longueuil, Québec
    Posts
    577
    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:

    Code:
    e.Graphics.DrawString(stringForPage, PrintFont, Brushes.Black, 50, 100, strFormat)
    Jacques Bourgeois
    JBFI
    http://www3.sympatico.ca/jbfi/homeus.htm

Similar Threads

  1. Replies: 0
    Last Post: 02-10-2009, 04:09 AM
  2. Create User Wizard
    By saquib189 in forum ASP.NET
    Replies: 1
    Last Post: 09-19-2008, 01:57 PM
  3. JDOM Classpath Help Required
    By kpandya in forum Java
    Replies: 5
    Last Post: 01-15-2006, 07:10 PM
  4. Replies: 0
    Last Post: 08-03-2002, 03:19 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


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


Sponsored Links