开发者

Textbox in Silverlight ChildWindow Click and Select Text Bug

开发者 https://www.devze.com 2023-01-30 00:23 出处:网络
I have a silverlight 4 childwindow that has a textbox.When I click existing text in the textbox, the click is registered about 25 pixels to the right.All other \"clicks\" (for buttons, etc) register w

I have a silverlight 4 childwindow that has a textbox. When I click existing text in the textbox, the click is registered about 25 pixels to the right. All other "clicks" (for buttons, etc) register where the mouse is. And a click to an empty text box also registers correctly. It is only if there is text in the textbox.

The behavior exists in both IE8 and Chrome. I've tried this with a new, stripped down project as well. Has anyone else has ever experienced the same behavior?

Update: It might also be relevant that I'm on a开发者_开发技巧 high res monitor and using a non standard dpi.


My MainPage.xaml:

<Grid x:Name="LayoutRoot" Background="White">
    <Button Content="Show" Click="Button_Click" />
</Grid>

My ChildWindow.xaml:

<Grid x:Name="LayoutRoot" Margin="2">
    <Grid.RowDefinitions>
        <RowDefinition />
        <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>
    <TextBox Width="200" />
    <Button x:Name="CancelButton" Content="Cancel" Click="CancelButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,0,0" Grid.Row="1" />
    <Button x:Name="OKButton" Content="OK" Click="OKButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,79,0" Grid.Row="1" />
</Grid>

My MainPage.xaml.cs for launching the ChildWindow:

private void Button_Click(object sender, RoutedEventArgs e)
{
    var window = new ChildWindow1();
    window.Show();
}


Not an answer, but I can reproduce this. When my browser zoom (in Chrome) is set to 100%, the clicks in the textbox register where they belong. As soon as I zoom in, the clicks start registering to the right of the actual click location.

Like you, I am using a high-dpi display and regularly use my browser at above 100% zoom.

Edit: a related bug is register at Connect: https://connect.microsoft.com/VisualStudio/feedback/details/588553/silverlight-4-thumb-does-not-correct-report-mouse-changes-at-non-100-zoom?wa=wsignin1.0#tabs

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号