Results 1 to 8 of 8

Thread: [2008] Rotate a label How?

Hybrid View

  1. #1
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2008] Rotate a label How?

    You can't. If you want to orient your text differently then you'll need to draw it using GDI+. GDI+ drawing is done on the Paint event of the control you want to draw on. This will draw text vertically on a form:
    vb.net Code:
    1. Public Class Form1
    2.  
    3.     Private Sub Form1_Paint(ByVal sender As Object, _
    4.                             ByVal e As PaintEventArgs) Handles Me.Paint
    5.         e.Graphics.DrawString("Hello World", _
    6.                               Me.Font, _
    7.                               Brushes.Black, _
    8.                               10, _
    9.                               10, _
    10.                               New StringFormat(StringFormatFlags.DirectionVertical))
    11.     End Sub
    12.  
    13. End Class
    You should read the documentation for the Graphics class, it's DrawString method and the StringFormat class, then experiment to see what else you can do.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  2. #2

    Thread Starter
    Addicted Member morkie's Avatar
    Join Date
    Jan 2009
    Location
    P4
    Posts
    202

    Re: [2008] Rotate a label How?

    it's works...but how can i place a label or move it into form

    it place at the upper left and can't select to move a control...

    how can i move the label..

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