locked
Windows 8 Textbox AutoComplete RRS feed

  • Question

  • Hi,

    I found that Windows 8 textbox has a property "IsPredictionEnabled". From MSDN, I understand it is used for enable autocomplete features. But setting this property has no effect. 

    Can anyone suggest me how to use this property?

    Regards,

    Jawahar

    Wednesday, August 15, 2012 3:07 AM

Answers

  • The source comes from internal language-specific dictionaries. Custom dictionaries are not supported.

    You should see predictions with the simulator. They will appear in a box in-line with the text:

    --Rob

    • Marked as answer by jawahar_16 Monday, August 27, 2012 5:57 AM
    Monday, August 27, 2012 5:26 AM
    Moderator

All replies

  • You might wanna look at InputScope property of the textbox, and the list of values that you can use here are listed here.

    Default    0   
    No input scope is applied.

    Url    1   
    Input scope is intended for working with a URL.

    EmailSmtpAddress    5   
    Input scope is intended for working with a SMTP form e-mail address (accountname@host).

    Number    29   
    Input scope is intended for working with digits 0-9.

    TelephoneNumber    32   
    Input scope is intended for telephone numbers.

    Search    51    
    Input scope is intended for search strings.

    NumberFullWidth    39   
    Input scope is intended for full-width number characters.

    AlphanumericHalfWidth    40    
    Input scope is intended for alphanumeric half-width characters.

    AlphanumericFullWidth    41   
    Input scope is intended for alphanumeric full-width characters.

    Hiragana    44   
    Input scope is intended for Hiragana characters.

    KatakanaHalfWidth    45    
    Input scope is intended for Katakana half-width characters.

    KatakanaFullWidth    46    
    Input scope is intended for Katakana full-width characters.

    Hanja    47    
    Input scope is intended for Hanja characters.

    HangulHalfWidth    48    
    Input scope is intended for Hangul half-width characters.

    HangulFullWidth    49    
    Input scope is intended for Hangul full-width characters.

    ChineseHalfWidth    53    
    Input scope is intended for Chinese half-width characters.

    ChineseFullWidth    54    
    Input scope is intended for Chinese full-width characters.

    NativeScript    55    
    Input scope is intended for native script.

    Good luck...


    Can Bilgin
    Blog CompuSight

    • Proposed as answer by Can Bilgin Tuesday, August 21, 2012 9:10 PM
    Wednesday, August 15, 2012 9:48 AM
  • If your question has been answered, please mark the appropriate post as answer so other community members with a similar question can find help faster.

    Can Bilgin
    Blog CompuSight

    Tuesday, August 21, 2012 9:12 PM
  • IsPredictionEnabled is just for built-in prediction (ie you type Micros and there is a popup with one suggestion Microsoft like on Windows Phone).

    For an AutoCompleteBox control, you'll have to code it yourself (or use the new Telerik suite). It's not very complicated to code one. You just need to susbribe to the TextChanged text and open a popup below the textbox with your suggestions (this is the basic explanation it might take a little bit more).


    Client Application Development MVP

    Wednesday, August 22, 2012 1:46 AM
  • Hi Benjamin,

    Yes I understand that this functionality can be done pro grammatically. But I just wonder, whether this property can do something. As you said it never open a suggestion popup when this is set to true.

    @Can Bilgin : Thanks for your information. The question is about "IsPredictionEnabled" and not "InputScope".

    Thanks,

    Thursday, August 23, 2012 4:56 PM
  • TextPrediction only happens when you are using a soft keybord. If you're typing on a hard keyboard you will not get the predictions.
    Thursday, August 23, 2012 7:42 PM
  • Hi Chipalo,

    So where the source coming from. Can we give predefined prediction strings?

    Also I have tried running in Simulator and virtual key pad and not able to see the predictions. Is there any sample or video that explains the feature well?

    Regards,

    Monday, August 27, 2012 5:06 AM
  • Could you try setting the input scope and then try to get the prediction... I realize the question is not about inputscope :) but input scope defines which kind of values are to be used as prediction.

    Can Bilgin
    Blog CompuSight


    • Edited by Can Bilgin Monday, August 27, 2012 5:09 AM
    Monday, August 27, 2012 5:09 AM
  • The source comes from internal language-specific dictionaries. Custom dictionaries are not supported.

    You should see predictions with the simulator. They will appear in a box in-line with the text:

    --Rob

    • Marked as answer by jawahar_16 Monday, August 27, 2012 5:57 AM
    Monday, August 27, 2012 5:26 AM
    Moderator
  • For an AutoCompleteBox control, you'll have to code it yourself (or use the new Telerik suite). It's not very complicated to code one. You just need to susbribe to the TextChanged text and open a popup below the textbox with your suggestions (this is the basic explanation it might take a little bit more).

    Which way would you approach limiting the user input to only words in the custom dictionary please?
    I was considering removing words after the space key is pressed if they're not in my dictionary.
    Thursday, October 23, 2014 10:19 AM
  • You may refer to this nuget

    https://www.nuget.org/packages/AutoCompleteBoxWinRT

    AutoCompleteBox for WinRT built using Reactive Extensions. For more info see https://github.com/igorkulman/AutoCompleteBox

    There is no AutoCompleteBox control that can be used when building Windows Store apps in C# and XAML so I decided to create one, because I needed it for a project. Currently it supports only String collections and the selected value must be accessed using code behind, but this will hopefully change.

    The AutoCompleteBox uses WinRT XAML Toolkit to show the watermark andReactive Extensions so the users does not need to press enter, the results will show after they stop typing for a second.

    Monday, November 3, 2014 8:03 AM