Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

IsTabStop="false" makes TextBox uneditable RSS

4 replies

Last post Oct 07, 2008 10:42 AM by chrishay_uk

(0)
  • chrishay_uk

    chrishay_uk

    Participant

    876 Points

    213 Posts

    IsTabStop="false" makes TextBox uneditable

    Oct 05, 2008 09:46 AM | LINK

    I think this is a bug if not, i think it should be.

    If I set IsTabStop="false" on the TextBox then I can longer edit the control.

    I think this is wrong as it's conceivable that I don't want to tab onto it, but I still want to use the control.

    If this has answered your question, please hit the Mark as Answered thingy.

    http://silverlightuk.blogspot.com/
  • StefanWick

    StefanWick

    Contributor

    3004 Points

    453 Posts

    Microsoft

    Re: IsTabStop="false" makes TextBox uneditable

    Oct 06, 2008 06:46 PM | LINK

    This behavior is by design for Silverlight. IsTabStop=false means the control can't receive focus. Thus it won't get input.

    Note that the design is different from WPF in this case.

    Thanks, Stefan Wick

    Microsoft Silverlight | http://blogs.msdn.com/swick/
  • ccoombs

    ccoombs

    Star

    9398 Points

    1325 Posts

    Re: IsTabStop="false" makes TextBox uneditable

    Oct 06, 2008 07:28 PM | LINK

    the textbox can still receive mouse events.  so when the textbox's mouseleftbuttonup event fires, set IsTabStop = true, and give the textbox focus.  then when the textbox loses focus, set IsTabStop back to false.

  • chrishay_uk

    chrishay_uk

    Participant

    876 Points

    213 Posts

    Re: Re: IsTabStop="false" makes TextBox uneditable

    Oct 07, 2008 10:05 AM | LINK

    ccoombs,

    thanks, i'll give that a go

    If this has answered your question, please hit the Mark as Answered thingy.

    http://silverlightuk.blogspot.com/
  • chrishay_uk

    chrishay_uk

    Participant

    876 Points

    213 Posts

    Re: Re: IsTabStop="false" makes TextBox uneditable

    Oct 07, 2008 10:42 AM | LINK

    Stefan,

    Thanks for the reply but other controls can receive focus (buttons, dropdown) via the mouse just not via the keyboard.  The probem is with the TextBox this means it effectively disables the TextBox just because you don't want to be tabbed onto it.

    The reason I don't want to be tabbed onto it is that Keyboard Events for the TabStops suppresses keyboard events for controls that are not TabStop's (e.g. the Image control)

    I think you are going to have some complaints from the Casual Gaming community who may wish to use a non TabStop control and a TextBox and find that when the Textbox is used it interferes with their game.  This is the exact situation I have with the Spectrum Emulator.  I think the suggestion from ccoombs will work but this is a hack.

    If this has answered your question, please hit the Mark as Answered thingy.

    http://silverlightuk.blogspot.com/