locked
Unable to Change InputScope

    Question

  • I need to change the InputScope of a TextBox in my code. I use the following code to do this:
    Me.txtRecipient.InputScope = New InputScope()
    Me.txtRecipient.InputScope.Names.Add(New InputScopeName(InputScopeNameValue.EmailSmtpAddress))
    This works the first time, but after it is set the first time, I cannot change it again (in other words, the code only works once) even though I assign a new instance of InputScope. What do I need to do to change the InputScope through code?

    Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/

    Tuesday, December 16, 2014 7:09 PM

Answers

  • How you test the code? I test the code in Simulator and when the page loaded, I assign the input scope to the textbox, also I have a button, after I click the button, I assign another input scope to the textbox which works fine.

    Email input scope before button click:

    Number input scope after button click

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, December 18, 2014 7:18 AM
    Moderator

All replies

  • Hi Nathan,

    Try this code instead, initialize a inputScope object and then apply to the textbox inputscope:

                var inputScope = new InputScope();
                inputScope.Names.Add(new InputScopeName(InputScopeNameValue.EmailSmtpAddress));
                txtRecipient.InputScope = inputScope;

    --James

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, December 17, 2014 1:55 AM
    Moderator
  • Can you elaborate some more with addition code. It's not clear how you are trying to change the inputscope of your textbox.

    Abdulwahab Suleiman

    Wednesday, December 17, 2014 2:35 AM
    Moderator
  • I also tried what you said, no difference. Any other ideas? Thanks.

    Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/

    Wednesday, December 17, 2014 2:58 AM
  • There is no other code; the code I show assigns a new InputScope and adds an InputScopeNameValue to it, I don't have any other code to show. Is there something else you were expecting to see in my code?

    Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/

    Wednesday, December 17, 2014 3:03 AM
  • How you test the code? I test the code in Simulator and when the page loaded, I assign the input scope to the textbox, also I have a button, after I click the button, I assign another input scope to the textbox which works fine.

    Email input scope before button click:

    Number input scope after button click

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, December 18, 2014 7:18 AM
    Moderator
  • Hi Nathan,

    Temporary close the thread since you are not back.

    I tested to change the input scope while running the app but I cannot reproduce the same behavior as you mentioned.

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, January 6, 2015 9:15 AM
    Moderator