本文整理匯總了VB.NET中System.Windows.Forms.Control.IsInputKey方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET Control.IsInputKey方法的具體用法?VB.NET Control.IsInputKey怎麽用?VB.NET Control.IsInputKey使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。
在下文中一共展示了Control.IsInputKey方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: Form1
' 導入命名空間
Imports System.Windows.Forms
Public Class Form1
Inherits Form
Public Sub New()
Dim panel As New FlowLayoutPanel()
Dim tabTextBox1 As New TabTextBox()
tabTextBox1.Text = "TabTextBox"
panel.Controls.Add(tabTextBox1)
Dim textBox1 As New TextBox()
textBox1.Text = "Normal TextBox"
panel.Controls.Add(textBox1)
Me.Controls.Add(panel)
End Sub
End Class
Class TabTextBox
Inherits TextBox
Protected Overrides Function IsInputKey( _
ByVal keyData As System.Windows.Forms.Keys) As Boolean
If keyData = Keys.Tab Then
Return True
Else
Return MyBase.IsInputKey(keyData)
End If
End Function
Protected Overrides Sub OnKeyDown( _
ByVal e As System.Windows.Forms.KeyEventArgs)
If e.KeyData = Keys.Tab Then
Me.SelectedText = " "
Else
MyBase.OnKeyDown(e)
End If
End Sub
End Class