Wednesday, 5 June 2013

windows-rotate lable 90 degree with paint

 private void label123_Paint(object sender, PaintEventArgs e)
        {
StringFormat format = new StringFormat();
            format.Alignment = StringAlignment.Center;

            SizeF txt = e.Graphics.MeasureString("Loans", this.Font);
            SizeF sz = e.Graphics.VisibleClipBounds.Size;
            //270 degrees

            e.Graphics.TranslateTransform(0, sz.Height);
            e.Graphics.RotateTransform(270);
            e.Graphics.DrawString("Loans", this.Font, Brushes.Black, new RectangleF(0, 0, sz.Height, sz.Width), format);
            e.Graphics.ResetTransform();
}

No comments:

Post a Comment

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...