2012-04-26 10 views
5

स्क्रॉल नहीं करता है, मैं दूसरे के बगल में 3 घटकों के साथ एक इंटरफ़ेस रखना चाहता हूं। पहला सूची सूची होगा और दो अन्य ग्रिड होंगे।स्क्रॉलव्यूयर

चूंकि घटक दाईं ओर बहेंगे, इसलिए मैं उन्हें स्क्रॉलव्यूअर में रखना चाहता हूं। मैं सफल नहीं हुआ। मैंने कोशिश करने के लिए वास्तव में एक सरल उदाहरण करने की कोशिश की, लेकिन उदाहरण भी विफल रहता है।

<ScrollViewer Grid.Column="1" Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Top" Width="600" Height="400"> 
     <StackPanel Width="1200" Height="400" Orientation="Horizontal"> 
      <Border Background="AntiqueWhite" Width="400" Height="400" HorizontalAlignment="Left" VerticalAlignment="Top" /> 
      <Border Background="Blue" Width="400" Height="400" HorizontalAlignment="Left" VerticalAlignment="Top" /> 
      <Border Background="LimeGreen" Width="400" Height="400" HorizontalAlignment="Left" VerticalAlignment="Top" /> 
     </StackPanel> 
    </ScrollViewer> 

जैसा कि आप देख सकते हैं, स्क्रॉलव्यूयर ग्रिड के अंदर है। मुझे क्या याद आया?

उत्तर

8

स्क्रॉल दर्शक पर सेटिंग्स इन गुणों का प्रयास करें: -

<ScrollViewer VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible" ZoomMode="Disabled" Grid.Column="1" Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Top" Width="600" Height="400"> 
    <StackPanel Width="1200" Height="400" Orientation="Horizontal"> 
     <Border Background="AntiqueWhite" Width="400" Height="400" HorizontalAlignment="Left" VerticalAlignment="Top" /> 
     <Border Background="Blue" Width="400" Height="400" HorizontalAlignment="Left" VerticalAlignment="Top" /> 
     <Border Background="LimeGreen" Width="400" Height="400" HorizontalAlignment="Left" VerticalAlignment="Top" /> 
    </StackPanel> 
</ScrollViewer> 

वह मेरे लिए सामान्य रूप से काम करता है!

+2

यह काम किया। यह जादूगर होना चाहिए ... धन्यवाद! – Jonas

+0

क्या आप मुझे स्पर्श इनपुट के लिए स्क्रॉलव्यूअर का उपयोग करके स्क्रॉल करने का तरीका सुझा सकते हैं। –

संबंधित मुद्दे