+ Reply to Thread
Results 1 to 2 of 2

Thread: center drawstring in vb.net

  1. #1
    quangha is offline VB.NET Forum Newbie quangha is on a distinguished programming path ahead
    .NET Framework
    .NET 3.5
    Join Date
    Jan 2010
    Age
    22
    Posts
    15
    Reputation
    10

    Default center drawstring in vb.net

    Hello, i want to ask how do you draw a string in a rectangle AND center aligned at the mid point of that rectangle ?
    I can wrap the draw string in a rectangle
    I can centered the drawstring at a point
    but can somebody combine them ?

  2. #2
    jmcilhinney's Avatar
    jmcilhinney is offline VB.NET Forum Moderator jmcilhinney has a reputation beyond repute jmcilhinney has a reputation beyond repute jmcilhinney has a reputation beyond repute jmcilhinney has a reputation beyond repute jmcilhinney has a reputation beyond repute jmcilhinney has a reputation beyond repute jmcilhinney has a reputation beyond repute jmcilhinney has a reputation beyond repute jmcilhinney has a reputation beyond repute jmcilhinney has a reputation beyond repute jmcilhinney has a reputation beyond repute
    .NET Framework
    .NET 3.5 (VS 2008)
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Age
    41
    Posts
    6,907
    Reputation
    670

    Default

    Call one of the overloads of DrawString that takes a StringFormat object as an argument. The StringFormat object lets you specify things like horizontal alignment.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

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