Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the scroll vertical and scroll horizantal for a page created in WPF

Tags:

scroll

xaml

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

<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.

like image 934
user301016 Avatar asked Jul 22 '09 14:07

user301016


People also ask

How do I add a vertical scroll bar in WPF?

How to enable scrollbar in a WPF TextBox. The simplest way to add scrolling functionality to a TextBox control is by enabling its horizontal and vertical scrolling. The HorizontalScrollBarVisibility and VerticalScrollBarVisibility properties are used to set horizontal and vertical scroll bars of a TextBox.

How do I add a vertical scroll?

For vertical scrollable bar use the x and y axis. Set the overflow-x:hidden; and overflow-y:auto; that will automatically hide the horizontal scroll bar and present only vertical scrollbar. Here the scroll div will be vertically scrollable.

How do I know which element is scrolling?

Hit F12 to open it and check the dom elements. You'll be able to find it.

Which is used to scroll the workspace horizontally or vertically?

A vertical or horizontal bar commonly on the far right or bottom of a window that lets you move the window viewing area up, down, left, or right. Most people today are familiar with scroll bars because of the need to scroll up and down on almost every Internet web page. Scroll bar overview.


1 Answers

Put your content inside a 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.

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

like image 109
Brandon Avatar answered Jan 01 '23 02:01

Brandon