|
|
|
Click here to copy the following block | Imports System.Windows.Forms
Public Class CompletionCombo Inherits ComboBox
Private _AutoComplete As Boolean = True
Protected Overrides Sub OnKeyDown(ByVal e As KeyEventArgs) _AutoComplete = e.KeyCode <> Keys.Delete And e.KeyCode <> Keys.Back MyBase.OnKeyDown(e) End Sub
Protected Overrides Sub OnTextChanged(ByVal e As EventArgs) If _AutoComplete Then Dim TextEntered As String = Me.Text Dim index As Integer = Me.FindString(TextEntered) If index >= 0 Then _AutoComplete = False Me.SelectedIndex = index _AutoComplete = True Me.Select(TextEntered.Length, Me.Text.Length) End If End If MyBase.OnTextChanged(e) End Sub End Class |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|