如何使滚动垂直并滚动horizantal为WPF中创建的页面

Ram*_*amm 5 xaml scroll

在一般的XAML代码中,我写了如下,

<pre>Page x:Class="UI_eHTMP.Window1" Title="eHTMP Application"
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   Height="800" Width="1400" Loaded="Window_Loaded" Title="applc1" Background="OldLace"&gt;</page></pre>
Run Code Online (Sandbox Code Playgroud)

当我运行应用程序并尝试恢复和最大化窗口页面时,我没有看到任务栏和垂直和水平滚动条滚动.

什么需要包含在XAML代码中?当我在XAML标题中提到时,甚至标题也不会显示.

Bra*_*don 8

将您的内容放在ScrollViewer中.

<Page x:Class="UI_eHTMP.Window1" Title="eHTMP Application"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="800" Width="1400" Loaded="Window_Loaded" Title="applc1" Background="OldLace">
    <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
        // Content
    </ScrollViewer>
</Page>
Run Code Online (Sandbox Code Playgroud)

如果这不起作用,请从页面中删除"宽度"和"高度"属性,但保留ScrollViewer.

至于标题,你已经指定了两次,一次是eHTMP应用程序,另一次是applc1.尝试删除其中一个.