- Version
- Download 94
- File Size 106.76 KB
- File Count 1
- Create Date March 11, 2016
- Last Updated March 11, 2016
AutoCompleteMode Textbox Property in Visual Basic .Net
AutoCompleteMode Textbox Property in Visual Basic .Net
Textbox.autocompletemode property in visual basic is useful for TextBox controls in which URLs, addresses, file names, or commands will be frequently entered.
AutoCompleteMode property has four values:
Suggest – displays value in a dropdown manner based on your input
Append – appends the most likely string you are looking for.
SuggestAppend – suggest and append
None (Default) – disable the completion
Source code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox1.AutoCompleteCustomSource.Add("Visual Basic 6")
TextBox1.AutoCompleteCustomSource.Add("Visual Basic .Net")
TextBox1.AutoCompleteCustomSource.Add("C#")
TextBox1.AutoCompleteCustomSource.Add("Java")
TextBox1.AutoCompleteCustomSource.Add("PHP/MySQL")
TextBox1.AutoCompleteCustomSource.Add("Javascript")
TextBox1.AutoCompleteCustomSource.Add("Ruby")
TextBox1.AutoCompleteCustomSource.Add("Phyton")
End Sub
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
AutoCompleteModeSelect()
End Sub
Private Sub AutoCompleteModeSelect()
If RadioButton1.Checked = True Then
TextBox1.AutoCompleteMode = AutoCompleteMode.Suggest
ElseIf RadioButton2.Checked = True Then
TextBox1.AutoCompleteMode = AutoCompleteMode.Append
ElseIf RadioButton3.Checked = True Then
TextBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend
End If
End Sub
Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
AutoCompleteModeSelect()
End Sub
Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged
AutoCompleteModeSelect()
End Sub
End Class