天天看点

[windows store 学习]ScrollViewer中TextBox自动获取焦点的问题

ScrollViewer的子控件中有TextBox,的话点击ScrollViewer内部焦点会自动到一个Textbox中去,解决办法设置ScrollViewer TabStop="true"

<ScrollViewer HorizontalAlignment="Left" Height="453" VerticalAlignment="Top" Width="400"  VerticalScrollMode="Disabled" BringIntoViewOnFocusChange="False" Background="Red" IsTabStop="True"  >

            <StackPanel  Height="400"  Width="261" Background="Black">

               <TextBox Background="Yellow"/>

                <TextBox />

                <TextBox Background="Yellow"/>

                <TextBox />

            </StackPanel>

        </ScrollViewer>

继续阅读