我们可以在VB.Net中更改标签大小吗?如果可以,请给我解决方案..... [英] can we change the label size in VB.Net?if yes give me solution.....
本文介绍了我们可以在VB.Net中更改标签大小吗?如果可以,请给我解决方案.....的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人知道吗?
我们可以在VB.Net中更改标签大小吗?如果可以,请给我解决方案.....
Can anyone know?
can we change the label size in VB.Net?if yes give me solution.....
推荐答案
亲爱的朋友,
下面的代码示例演示AutoSize属性.要运行此示例,请将以下代码粘贴到窗体中,然后从窗体的构造函数或Load方法中调用InitializeLabel方法.
Dear Friend,
The following code example demonstrates the AutoSize property. To run this example, paste the following code in a form and call the InitializeLabel method from the form''s constructor or Load method.
' Declare a label.
Friend WithEvents Label1 As System.Windows.Forms.Label
' Initialize the label.
Private Sub InitializeLabel()
Me.Label1 = New Label
Me.Label1.Location = New System.Drawing.Point(10, 10)
Me.Label1.Name = "Label1"
Me.Label1.TabIndex = 0
' Set the label to a small size, but set the AutoSize property
' to true. The label will adjust its length so all the text
' is visible, however if the label is wider than the form,
' the entire label will not be visible.
Me.Label1.Size = New System.Drawing.Size(10, 10)
Me.Controls.Add(Me.Label1)
Me.Label1.AutoSize = True
Me.Label1.Text = "The text in this label is longer than the set size."
End Sub
这篇关于我们可以在VB.Net中更改标签大小吗?如果可以,请给我解决方案.....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文