locked
Textbox Autocomplete RRS feed

  • Question

  • Hi Guys,

    Problem with my textbox autocomplete, kinda struggling check my codes here:

    Textbox1.AutoCompleteMode = AutoCompleteMode.Suggest
    Textbox1.AutoCompleteSource = AutoCompleteSource.CustomSource

    There's no data value suggest?

    Thursday, January 23, 2014 3:06 AM

Answers

  • Hi,

    the question is kinda less information, where data would be getting on or listed data? if you are referring an example code,

    Try this code:

    Declare Variable:
    
    Dim strItems As List(Of String)
    'Or
    Dim strItems as AutoCompleteStringCollection

    Then you need to insert data list:

    strItems.add("example@email.com1")

    strItems.add("example@email.com2")

    strItems.add("example@email.com3")

    strItems.add("example@email.com4")

    After the strItems fill out

    You use it in textchanged event in a textbox:

    Textbox1.AutoCompleteMode = AutoCompleteMode.Suggest Textbox1.AutoCompleteSource = AutoCompleteSource.CustomSource

    'Do Not Forget the source to include

    Textbox1.AutoCompleteCustomSource = strItems


     
    • Marked as answer by VBcodeHyper Thursday, January 23, 2014 3:17 AM
    Thursday, January 23, 2014 3:14 AM
  • Hi Guys,

    Problem with my textbox autocomplete, kinda struggling check my codes here:

    Textbox1.AutoCompleteMode = AutoCompleteMode.Suggest
    Textbox1.AutoCompleteSource = AutoCompleteSource.CustomSource

    There's no data value suggest?


    When you set it to CustomSource, you then likewise need to set up that custom source (a collection) and set it to that custom source.

    Please call me Frank :)

    • Marked as answer by VBcodeHyper Thursday, January 23, 2014 3:17 AM
    Thursday, January 23, 2014 3:15 AM

All replies

  • Hi,

    the question is kinda less information, where data would be getting on or listed data? if you are referring an example code,

    Try this code:

    Declare Variable:
    
    Dim strItems As List(Of String)
    'Or
    Dim strItems as AutoCompleteStringCollection

    Then you need to insert data list:

    strItems.add("example@email.com1")

    strItems.add("example@email.com2")

    strItems.add("example@email.com3")

    strItems.add("example@email.com4")

    After the strItems fill out

    You use it in textchanged event in a textbox:

    Textbox1.AutoCompleteMode = AutoCompleteMode.Suggest Textbox1.AutoCompleteSource = AutoCompleteSource.CustomSource

    'Do Not Forget the source to include

    Textbox1.AutoCompleteCustomSource = strItems


     
    • Marked as answer by VBcodeHyper Thursday, January 23, 2014 3:17 AM
    Thursday, January 23, 2014 3:14 AM
  • Hi Guys,

    Problem with my textbox autocomplete, kinda struggling check my codes here:

    Textbox1.AutoCompleteMode = AutoCompleteMode.Suggest
    Textbox1.AutoCompleteSource = AutoCompleteSource.CustomSource

    There's no data value suggest?


    When you set it to CustomSource, you then likewise need to set up that custom source (a collection) and set it to that custom source.

    Please call me Frank :)

    • Marked as answer by VBcodeHyper Thursday, January 23, 2014 3:17 AM
    Thursday, January 23, 2014 3:15 AM
  • Hi Frank and Har,

    Thanks for the reply, yet i do realized that no collection of source come up with the suggest

    Thursday, January 23, 2014 3:17 AM