help with textbox printing location

DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: help with textbox printing location

  1. #1
    Join Date
    Nov 2004

    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
    Longueuil, Québec
    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)
    Jacques Bourgeois

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

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
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center