如何在VB.net中将标签控件旋转到某个角度 [英] How to Rotate a Label Control In VB.net to some angle

查看:708
本文介绍了如何在VB.net中将标签控件旋转到某个角度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何在Vb.net中将标签控件旋转到某个角度

Hi,
How to Rotate a Label Control to Some angle in Vb.net

推荐答案

这是一个C#解决方案应该是很容易适应或至少让你知道如何实现它:

自定义文本 - C#中的定向控件 - 第一部分(标签控制) [ ^ ]
Here is a C# solution that should be easily adapted or at least give you an idea how to achieve it:
Customized Text - Orientated Controls in C# - Part I (Label Control)[^]


Private Sub Label1_Paint( ByVal sender As Object,ByVal e As System.Windows.Forms.PaintEventArgs)Handles Label1.Paint

Label1.Text =""

e.Graphics.TranslateTransform( Label1.ClientSize.Width,Label1.ClientSize.Height)

e.Graphics.RotateTransform(180)

e.Graphics.DrawString(Hello,Label1.Font, Brushes.Black,RectangleF.op_Implicit(La bel1.ClientRectangle))

End Sub
Private Sub Label1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Label1.Paint
Label1.Text = ""
e.Graphics.TranslateTransform(Label1.ClientSize.Width, Label1.ClientSize.Height)
e.Graphics.RotateTransform(180)
e.Graphics.DrawString("Hello", Label1.Font, Brushes.Black, RectangleF.op_Implicit(Label1.ClientRectangle))
End Sub


这篇关于如何在VB.net中将标签控件旋转到某个角度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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