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

时间:2022-04-15 19:39:48

In the general XAML code, I have written as follows,

在一般的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>

When I run the appliction and try to restore and Maximize the windows page, I don't see the task bar and vertical and horizantal scroll bars to scroll.

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

What needs to be included in the XAML code? Even the title is also not displayed when i have mentioned in the XAML title.

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

1 个解决方案

#1


Put your content inside a ScrollViewer.

将您的内容放在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>

If that doesn't work, remove the Width and Height properties from the Page, but keep the ScrollViewer.

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

As for the title, you've specified it twice, once as eHTMP Application and again as applc1. Try removing one of them.

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

#1


Put your content inside a ScrollViewer.

将您的内容放在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>

If that doesn't work, remove the Width and Height properties from the Page, but keep the ScrollViewer.

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

As for the title, you've specified it twice, once as eHTMP Application and again as applc1. Try removing one of them.

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