本文整理汇总了VB.NET中System.Windows.Forms.Label类的典型用法代码示例。如果您正苦于以下问题:VB.NET Label类的具体用法?VB.NET Label怎么用?VB.NET Label使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Label类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: CreateMyLabel
Public Sub CreateMyLabel()
' Create an instance of a Label.
Dim label1 As New Label()
' Set the border to a three-dimensional border.
label1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
' Set the ImageList to use for displaying an image.
label1.ImageList = imageList1
' Use the second image in imageList1.
label1.ImageIndex = 1
' Align the image to the top left corner.
label1.ImageAlign = ContentAlignment.TopLeft
' Specify that the text can display mnemonic characters.
label1.UseMnemonic = True
' Set the text of the control and specify a mnemonic character.
label1.Text = "First &Name:"
' Set the size of the control based on the PreferredHeight and PreferredWidth values.
label1.Size = New Size(label1.PreferredWidth, label1.PreferredHeight)
'...Code to add the control to the form...
End Sub