1
https://stackoverflow.com/questions/1371943/c-sharp-vertical-label-in-a-windows-forms
0
Rajkiran is the currect .One change there and the code may help you
- private void button1_Click(object sender, EventArgs e)
- {
- GenerateTexture();
- }
- private void GenerateTexture()
- {
- StringFormat format = new StringFormat();
- format.Alignment = StringAlignment.Center;
- format.LineAlignment = StringAlignment.Center;
- format.Trimming = StringTrimming.EllipsisCharacter;
-
- Bitmap img = new Bitmap(this.Height, this.Width);
- Graphics G = Graphics.FromImage(img);
-
- G.Clear(this.BackColor);
-
- SolidBrush brush_text = new SolidBrush(this.ForeColor);
- G.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;
- G.DrawString(label1.Text, this.Font, brush_text, new Rectangle(0, 0, img.Width, img.Height), format);
- brush_text.Dispose();
-
- img.RotateFlip(RotateFlipType.Rotate270FlipNone);
-
- this.BackgroundImage = img;
- }
0
HI,
Refer below link :-
It is for 90 degrees.So make changes as 180 degrees.
http://www.c-sharpcorner.com/forums/rotate-a-lable-in-c-sharp
Hope it helps..