本文整理汇总了VB.NET中System.Windows.Forms.MaskedTextBox类的典型用法代码示例。如果您正苦于以下问题:VB.NET MaskedTextBox类的具体用法?VB.NET MaskedTextBox怎么用?VB.NET MaskedTextBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MaskedTextBox类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的VB.NET代码示例。
示例1: If
Private Sub MaskedTextBox1_MaskInputRejected(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MaskInputRejectedEventArgs) Handles MaskedTextBox1.MaskInputRejected
If (Me.MaskedTextBox1.MaskFull) Then
ToolTip1.ToolTipTitle = "Input Rejected - Too Much Data"
ToolTip1.Show("You cannot enter any more data into the date field. Delete some characters in order to insert more data.", Me.MaskedTextBox1, Me.MaskedTextBox1.Location.X, Me.MaskedTextBox1.Location.Y, 5000)
ElseIf (e.Position = Me.MaskedTextBox1.Mask.Length) Then
ToolTip1.ToolTipTitle = "Input Rejected - End of Field"
ToolTip1.Show("You cannot add extra characters to the end of this date field.", Me.MaskedTextBox1, 0, -20, 5000)
Else
ToolTip1.ToolTipTitle = "Input Rejected"
ToolTip1.Show("You can only add numeric characters (0-9) into this date field.", Me.MaskedTextBox1, 0, -20, 5000)
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.ToolTip1.IsBalloon = True
Me.MaskedTextBox1.Mask = "00/00/0000"
End Sub
Private Sub MaskedTextBox1_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs) Handles MaskedTextBox1.KeyDown
' The balloon tip is visible for five seconds; if the user types any data before it disappears, collapse it ourselves.
Me.ToolTip1.Hide(Me.MaskedTextBox1)
End Sub
开发者ID:VB.NET开发者,项目名称:System.Windows.Forms,代码行数:22,代码来源:MaskedTextBox
注:本文中的System.Windows.Forms.MaskedTextBox类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论