本文整理匯總了VB.NET中System.Windows.Forms.UpDownBase.Text屬性的典型用法代碼示例。如果您正苦於以下問題:VB.NET UpDownBase.Text屬性的具體用法?VB.NET UpDownBase.Text怎麽用?VB.NET UpDownBase.Text使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類System.Windows.Forms.UpDownBase
的用法示例。
在下文中一共展示了UpDownBase.Text屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: If
Private Sub numericUpDown1_Leave(sender As Object, e As EventArgs)
' If the entered value is greater than Minimum or Maximum,
' select the text and open a message box.
If (System.Convert.ToInt32(numericUpDown1.Text) > numericUpDown1.Maximum) Or _
(System.Convert.ToInt32(numericUpDown1.Text) < numericUpDown1.Minimum) Then
MessageBox.Show("The value entered was not between the Minimum and " & _
"Maximum allowable values." & Microsoft.VisualBasic.ControlChars.Cr & _
"Please re-enter.")
numericUpDown1.Focus()
numericUpDown1.Select(0, numericUpDown1.Text.Length)
End If
End Sub
Private Sub button1_Click(sender As Object, e As EventArgs)
Dim varPrefHeight1 As Integer
' Capture the PreferredHeight before and after the Font
' is changed, and display the results in a message box.
varPrefHeight1 = numericUpDown1.PreferredHeight
numericUpDown1.Font = New System.Drawing.Font("Microsoft Sans Serif", _
12F, System.Drawing.FontStyle.Bold)
MessageBox.Show("Before Font Change: " & varPrefHeight1.ToString() & _
Microsoft.VisualBasic.ControlChars.Cr & "After Font Change: " & _
numericUpDown1.PreferredHeight.ToString())
End Sub