旋转后标签不显示文字 [英] Label not showing text after rotate

查看:130
本文介绍了旋转后标签不显示文字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨伙计



简单的表格,上面只有一个我要旋转的标签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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆