问题描述:

I have a WPF application.

I use telerik and in one of the panes I have a WindowsFormsHost to host a winforms.

My problem: whenever I resize the pane in a way that a horizontal scroller becomes visibile, the scroller is behaving in a wierd way: if the scroller is all the way to the right then the winforms/WindowsFormsHost that is displayed is all the way to the left and vise versa.

I have tried playing with snoop, changing the FlowDirection but it doesn't help (and the FlowDirection is always LeftToRight).

Any ideas?

This is the relevent part of the code:

<telerik:RadDocking PanesSource="{Binding Items}" telerik:RadDocking.SerializationTag="itemDocking" x:Name="itemDocking" BorderBrush="Transparent" BorderThickness="

<telerik:RadDocking.DocumentHost>

<telerik:RadSplitContainer BorderBrush="Transparent" BorderThickness="0">

<telerik:RadPaneGroup BorderBrush="Transparent" BorderThickness="0">

<telerik:RadDocumentPane BorderBrush="Transparent" BorderThickness="0" telerik:RadDocking.SerializationTag="MainItemHost" IsHidden="False" Visibility="Collapsed" CanUserClose="False">

<WindowsFormsHost x:Name="itemFormsHost">

</WindowsFormsHost>

</telerik:RadDocumentPane>

</telerik:RadPaneGroup>

</telerik:RadSplitContainer>

</telerik:RadDocking.DocumentHost>

网友答案:

After BugFinder's comment I started looking in the whole solution for that code in the xaml/xaml.cs. When I couldn't find anything I understood that it must be in the Winforms. Apparently one of the items in the form (which is a tree control) had a:

tree.RightToLeft = RightToLeft.Yes;

Which caused the scroll to act that way (even though the whole tree display was Left to Right). I understood that the bug was in the tree when I noticed that when I move the scroll it only effects the tree (which takes the whole length) and the toolbar in the form.

Hope this helps someone and thank you BugFinder for guiding me to the solution.

相关阅读:
Top