none
filter from any part RRS feed

  • Question

  • hi

    I want filtering textbox with autocomplete custom source where any part of the word is done and not just presented

    Wednesday, December 5, 2018 5:16 PM

Answers

  • If you don't mind adding a C# custom TextBox to your solution then check out the following.

    My code sample using this custom control.

    https://1drv.ms/u/s!AtGAgKKpqdWjjG1UDQutKBOIxHTQ

    In this sample 52,000 plus items are contained in the auto complete source.

    VB.NET Form code where I added a reference to the C# project, built it then added the custom TextBox to the VB.NET form.

    Imports System.IO
    Public Class Form1
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            AutoCompleteTextbox1.AutoCompleteList =
                File.ReadAllLines(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "en-EN.dic")).ToList()
        End Sub
    
        Private Sub cmdGetSelected_Click(sender As Object, e As EventArgs) Handles cmdGetSelected.Click
            If Not String.IsNullOrWhiteSpace(AutoCompleteTextbox1.Text) Then
                MessageBox.Show($"You picked '{AutoCompleteTextbox1.Text}'")
            End If
        End Sub
    End Class
    


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by ahmeddc Thursday, December 6, 2018 12:42 AM
    Wednesday, December 5, 2018 5:45 PM
    Moderator

All replies

  • hi

    I want filtering textbox with autocomplete custom source where any part of the word is done and not just presented

    Hi

    Show an example of AutoComplete source. User Input, expected result/action.


    Regards Les, Livingston, Scotland

    Wednesday, December 5, 2018 5:40 PM
  • If you don't mind adding a C# custom TextBox to your solution then check out the following.

    My code sample using this custom control.

    https://1drv.ms/u/s!AtGAgKKpqdWjjG1UDQutKBOIxHTQ

    In this sample 52,000 plus items are contained in the auto complete source.

    VB.NET Form code where I added a reference to the C# project, built it then added the custom TextBox to the VB.NET form.

    Imports System.IO
    Public Class Form1
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            AutoCompleteTextbox1.AutoCompleteList =
                File.ReadAllLines(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "en-EN.dic")).ToList()
        End Sub
    
        Private Sub cmdGetSelected_Click(sender As Object, e As EventArgs) Handles cmdGetSelected.Click
            If Not String.IsNullOrWhiteSpace(AutoCompleteTextbox1.Text) Then
                MessageBox.Show($"You picked '{AutoCompleteTextbox1.Text}'")
            End If
        End Sub
    End Class
    


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by ahmeddc Thursday, December 6, 2018 12:42 AM
    Wednesday, December 5, 2018 5:45 PM
    Moderator
  • hi

    I want filtering textbox with autocomplete custom source where any part of the word is done and not just presented

    Hi

    Show an example of AutoComplete source. User Input, expected result/action.


    Regards Les, Livingston, Scotland

    I am adding items in AutoComplete source

    I want to use the user to select the filter

    example

    add text box   fill  AutoComplete source :

    alie

    amir

    user write in textbox

    ie =  alie

    filter AutoComplete source


    Wednesday, December 5, 2018 11:54 PM
  • Hi

    I see what you mean, you want the user input to find a match anywhere within any of the List items.

    I do not believe it is possible without rebuilding the AutoCompleteSource each keypress from User - with original AutoCompleteSource items that .Contains User input, resetting to original List when no match or selection made (maybe other events too)

    Best to forget that I would say.


    Regards Les, Livingston, Scotland

    Thursday, December 6, 2018 12:36 AM
  • Hi

    I see what you mean, you want the user input to find a match anywhere within any of the List items.

    I do not believe it is possible without rebuilding the AutoCompleteSource each keypress from User - with original AutoCompleteSource items that .Contains User input, resetting to original List when no match or selection made (maybe other events too)

    Best to forget that I would say.


    Regards Les, Livingston, Scotland

    thanks
    Thursday, December 6, 2018 12:42 AM