旋转后标签不显示文字 [英] Label not showing text after rotate
问题描述
嗨伙计
简单的表格,上面只有一个我要旋转的标签180.
以下代码没有错误,我可以看到它没有显示任何内容。
任何想法?
提前谢谢
我尝试过:
公开Class Form1
Private Sub label1_Paint(ByVal sender As Object,ByVal e As System.Windows.Forms.PaintEventArgs)处理label1.Paint
label1.Text =
e.Graphics.TranslateTransform(lblPlayer1Chips.ClientSize.Width,lblPlayer1Chips.ClientSize.Height)
e.Graphics.RotateTransform(180)
e.Graphics.DrawString(颠倒,label1.Font,
Brushes.Black,RectangleF.op_Implicit(label1.ClientRectangle))
结束子
结束类
也许你不旋转右边区域。尝试TranslateTransform的控件的宽度和高度...
......最后在完成Paint-Method之前执行ResetTransform ...
hi guys
Simple form with only one label on it that I want to rotate 180.
The following code has no errors that I can see yet it displayes nothing.
any ideas?
thank in advance
What I have tried:
Public Class Form1
Private Sub label1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles label1.Paint
label1.Text = ""
e.Graphics.TranslateTransform(lblPlayer1Chips.ClientSize.Width, lblPlayer1Chips.ClientSize.Height)
e.Graphics.RotateTransform(180)
e.Graphics.DrawString("upside down", label1.Font,
Brushes.Black, RectangleF.op_Implicit(label1.ClientRectangle))
End Sub
End Class
Perhaps you rotate not the right area. Try the width and the Height of the Control for TranslateTransform ...
... and finally do a ResetTransform before finishing the Paint-Method ...
这篇关于旋转后标签不显示文字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!