2011-01-13 51 views
0
<Slider Name="photoZoomSlider" Width="180" Minimum="100" Maximum="700" Value="300" /> 
     <ScrollViewer > 
      <Viewbox Width="{Binding ElementName=photoZoomSlider, Path=Value}" Height="{Binding ElementName=photoZoomSlider, Path=Value}"> 
       <StackPanel> 
       <Image Name="Photo" Source="C:\dic.bmp" Width="100" Height="100"/> 
        <TextBox Width="100"></TextBox> 
        <TextBox Width="200" Padding="5"></TextBox> 
        <TextBox Width="10"></TextBox> 
        <TextBox Width="500"></TextBox> 
       </StackPanel> 
       <!--<Viewbox.LayoutTransform> 
        <ScaleTransform x:Name="uiZoomTransform" 
        ScaleX="{Binding ElementName=photoZoomSlider, Path=Value}" 
        ScaleY="{Binding ElementName=photoZoomSlider, Path=Value}"/> 
       </Viewbox.LayoutTransform>--> 

      </Viewbox> 
     </ScrollViewer> 
    </StackPanel> 

調整滑塊時,TextBox無法顯示焦點,當我點擊文本框時,請問如何解決? 謝謝!關於比例文本框的wpf問題

+0

你問同樣的問題三次:http://stackoverflow.com/questions/4567910/wpf-scale文本框文本框不能顯示光標當我點擊文本框 – 2011-01-13 03:31:36

回答

0

我想你給什麼,並與一些小的調整,它工作正常:

<StackPanel> 
     <Slider Name="photoZoomSlider" Width="200" Height="50" Value="50" /> 
     <ScrollViewer> 
      <Viewbox Width="{Binding ElementName=photoZoomSlider, Path=Value}" Height="{Binding ElementName=photoZoomSlider, Path=Value}"> 
       <StackPanel> 
        <TextBox Text="ff" /> 
        <TextBox Text="ss" /> 
        <TextBox Text="zz" /> 
        <TextBox Text="cc" /> 
       </StackPanel> 
       <Viewbox.LayoutTransform> 
        <ScaleTransform x:Name="uiZoomTransform" ScaleX="{Binding ElementName=photoZoomSlider, Path=Value}" 
         ScaleY="{Binding ElementName=photoZoomSlider, Path=Value}"/> 
       </Viewbox.LayoutTransform> 

      </Viewbox> 
     </ScrollViewer> 
    </StackPanel> 
+0

這不是我想要得到的答案,問題對我來說也是一樣的。謝謝你的答案。 – doull 2011-01-13 04:49:50