Results 1 to 7 of 7

Thread: MeasureString problem [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member wolfrose's Avatar
    Join Date
    Aug 2002
    Location
    Indiana
    Posts
    309

    MeasureString problem [RESOLVED]

    I'm making an invoice printing program and I would like to print the invoice number in a box and center it automatically.

    VB Code:
    1. Dim invSize As SizeF = e.Graphics.MeasureString(InvNumber, fFont)
    2.         Dim iX As Integer
    3.         iX = 560 + (200 - CInt(invSize.Width) / 2)

    The number is now right justified in the box, not in the center. What am I doing wrong?

    560 is the x coordinate of the box, and 200 is the width.
    Last edited by wolfrose; Aug 8th, 2003 at 04:48 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
  •  



Click Here to Expand Forum to Full Width