First, I Zoom(ScaleTransform) the TextBox
, then mouse to click on the TextBox
. Sometimes can display the cursor, and sometimes can notdisplay the cursor. Looking for a solution to solution to the problem. I hope that I can show the cursor after I scale the TextBox
.
<Grid>
<StackPanel>
<TextBox Width="200"></TextBox>
<TextBox Width="100"></TextBox>
<TextBox Width="300"></TextBox>
<TextBox Width="100"></TextBox>
<TextBox Width="100"></TextBox>
<TextBox Width="100"></TextBox>
</StackPanel>
<Grid.LayoutTransform>
<ScaleTransform ScaleX="0.3" ScaleY="0.65"></ScaleTransform>
</Grid.LayoutTransform>
</Grid>
A
TextBox
, especially aTextBox
, is going to look bad and behave badly when scaled down. If you want yourTextBox
to look good and behave well, then useFontSize
to reduce it and your font rendering and your cursor management will work better.From an msdn answer I found:
The best workaround I work out is to apply an inverse transform on the TextBox and change the FontSize against the transform scale. You can wrap the TextBox with a Grid to maintain it's layout.
You can use the following code to see the effect. The FontSize in this sample is hardcoded to 10. You can use DataBinding to bind it to the scaletransform and use a converter to calculate a font size.
You can see the full thread here: http://social.msdn.microsoft.com/Forums/en/wpf/thread/aeaa3e28-a7da-4208-9676-771231c1a954?prof=required