0

我在网格内设置 TabIndex 属性。我的代码是`

        <Grid Margin="30,12" Grid.Row="1" Grid.Column="1" Background="White">
            <TextBlock  Foreground="#FF858585" Grid.Row="1" Grid.Column="0" Text="{Binding Path=LocalizedResources.Password, Source={StaticResource LocalizedStrings}}" 
              Padding="10,8"  x:Name="tb_pwd" />
            <PasswordBox TabIndex="1" Password=""  Background="Transparent"  BorderBrush="#FF1ba1e2"
                        Style="{StaticResource PwdBoxStyle}" Grid.Row="1" MaxLength="15" GotFocus="txtpwd_GotFocus_1" LostFocus="txtpwd_LostFocus_1" x:Name="txtpwd">
            </PasswordBox>
        </Grid>

        <Grid Grid.Row="2" Grid.Column="1"  Margin="30,0" Background="White">
            <TextBlock  Foreground="#FF858585" Grid.Row="2" Grid.Column="0" Text="{Binding Path=LocalizedResources.Domain, Source={StaticResource LocalizedStrings}}" 
                        Padding="10,8"  x:Name="tb_domain" />
            <TextBox TabIndex="2"  Text="" Background="Transparent"  BorderBrush="#FF1ba1e2"   
                      Style="{StaticResource TxtBoxStyle}" 
                      Grid.Row="2" GotFocus="txtdomain_GotFocus_1"
                      LostFocus="txtdomain_LostFocus_1" 
                      Grid.Column="1" x:Name="txtdomain" MaxLength="15" />
        </Grid>`

但是在模拟器中,当我写用户名并单击选项卡时它不起作用。有什么建议么?

4

1 回答 1

1

Windows Phone 上的 SIP(​​键盘)不包含 Tab 键,因此内部不支持此功能。

应用程序中的实际约定是在用户按下回车键时从代码中推进选项卡焦点。
网上有很多资源展示了如何做到这一点,还有帮助类使其变得非常简单。

于 2013-11-06T13:07:33.333 回答