title: How do I rotate a label in Vb net?
body: <p>I'm trying to rotate a label 90 degrees in Vb net and cannot get it working. My code is as follows. Any help would be appreciated.</p>
  
  <hr>
  
  <pre><code>    Private Sub Label1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
  
      Dim sf As New StringFormat
  
      sf.Alignment = StringAlignment.Center
  
      sf.LineAlignment = StringAlignment.Center
  
      MetroLabel50.Text = ""
  
      e.Graphics.TranslateTransform(MetroLabel50.ClientSize.Width, MetroLabel50.ClientSize.Height)
  
      e.Graphics.RotateTransform(90)
  
      e.Graphics.DrawString("Label", MetroLabel50.Font, Brushes.Black, RectangleF.op_Implicit(MetroLabel50.ClientRectangle), sf)
  
      e.Graphics.ResetTransform()
  
  End Sub
  </code></pre>