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

Excel Sort values in ascending order using function TEXTJOIN

 Excel ::  Text ::  1,3,5,2,9,5,11 Result :: 1,2,3,5,5,9,11 Formula ::     TEXTJOIN ( ",",1,SORT(MID(SUBSTITUTE( A1 ,","...