ScrollBarVisibility 열거형

정의

스크롤할 수 있는 콘텐츠의 ScrollBar 표시 여부를 지정합니다.Specifies the visibility of a ScrollBar for scrollable content.

public enum class ScrollBarVisibility
public enum ScrollBarVisibility
type ScrollBarVisibility = 
Public Enum ScrollBarVisibility
상속
ScrollBarVisibility

필드

Auto 1

뷰포트에 일부 콘텐츠를 표시할 수 없으면 ScrollBar가 나타나고 ScrollViewer의 차원이 콘텐츠에 적용됩니다.A ScrollBar appears and the dimension of the ScrollViewer is applied to the content when the viewport cannot display all of the content. 가로 ScrollBar의 경우 콘텐츠의 너비는 ViewportWidthScrollViewer로 설정됩니다.For a horizontal ScrollBar, the width of the content is set to the ViewportWidth of the ScrollViewer. 세로 ScrollBar의 경우 콘텐츠의 높이는 ViewportHeightScrollViewer로 설정됩니다.For a vertical ScrollBar, the height of the content is set to the ViewportHeight of the ScrollViewer.

Disabled 0

뷰포트에 일부 콘텐츠를 표시할 수 없는 경우에도 ScrollBar가 표시되지 않습니다.A ScrollBar does not appear even when the viewport cannot display all of the content. 콘텐츠의 차원은 ScrollViewer 부모의 해당 차원으로 설정됩니다.The dimension of the content is set to the corresponding dimension of the ScrollViewer parent. 가로 ScrollBar의 경우 콘텐츠의 너비는 ViewportWidthScrollViewer로 설정됩니다.For a horizontal ScrollBar, the width of the content is set to the ViewportWidth of the ScrollViewer. 세로 ScrollBar의 경우 콘텐츠의 높이는 ViewportHeightScrollViewer로 설정됩니다.For a vertical ScrollBar, the height of the content is set to the ViewportHeight of the ScrollViewer.

Hidden 2

뷰포트에 일부 콘텐츠를 표시할 수 없는 경우에도 ScrollBar가 표시되지 않습니다.A ScrollBar does not appear even when the viewport cannot display all of the content. ScrollViewer의 차원은 콘텐츠에 적용되지 않습니다.The dimension of the ScrollViewer is not applied to the content.

Visible 3

ScrollBar가 항상 나타납니다.A ScrollBar always appears. ScrollViewer의 차원이 콘텐츠에 적용됩니다.The dimension of the ScrollViewer is applied to the content. 가로 ScrollBar의 경우 콘텐츠의 너비는 ViewportWidthScrollViewer로 설정됩니다.For a horizontal ScrollBar, the width of the content is set to the ViewportWidth of the ScrollViewer. 세로 ScrollBar의 경우 콘텐츠의 높이는 ViewportHeightScrollViewer로 설정됩니다.For a vertical ScrollBar, the height of the content is set to the ViewportHeight of the ScrollViewer.

예제

다음 예제에서는이 열거형의 멤버 값을 설정 하는 데는 HorizontalScrollBarVisibility 의 속성을 ScrollViewer 컨트롤.The following example shows how to use the member values of this enumeration to set the HorizontalScrollBarVisibility property of the ScrollViewer control.


// Create the application's main window
mainWindow = gcnew System::Windows::Window();
mainWindow->Title = "ScrollViewer Sample";

// Define a ScrollViewer
myScrollViewer = gcnew ScrollViewer();
myScrollViewer->HorizontalScrollBarVisibility = ScrollBarVisibility::Auto;

// Add Layout control
myStackPanel = gcnew StackPanel();
myStackPanel->HorizontalAlignment = HorizontalAlignment::Left;
myStackPanel->VerticalAlignment = VerticalAlignment::Top;

TextBlock^ myTextBlock = gcnew TextBlock();
myTextBlock->TextWrapping = TextWrapping::Wrap;
myTextBlock->Margin = System::Windows::Thickness(0, 0, 0, 20);
myTextBlock->Text = "Scrolling is enabled when it is necessary. Resize the Window, making it larger and smaller.";

Rectangle^ myRectangle = gcnew Rectangle();
myRectangle->Fill = Brushes::Red;
myRectangle->Width = 500;
myRectangle->Height = 500;

// Add child elements to the parent StackPanel
myStackPanel->Children->Add(myTextBlock);
myStackPanel->Children->Add(myRectangle);

// Add the StackPanel as the lone Child of the Border
myScrollViewer->Content = myStackPanel;

// Add the Border as the Content of the Parent Window Object
mainWindow->Content = myScrollViewer;
mainWindow->Show();


// Create the application's main window
mainWindow = new Window ();
mainWindow.Title = "ScrollViewer Sample";

// Define a ScrollViewer
myScrollViewer = new ScrollViewer();
myScrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;

// Add Layout control
myStackPanel = new StackPanel();
myStackPanel.HorizontalAlignment = HorizontalAlignment.Left;
myStackPanel.VerticalAlignment = VerticalAlignment.Top;

TextBlock myTextBlock = new TextBlock();
myTextBlock.TextWrapping = TextWrapping.Wrap;
myTextBlock.Margin = new Thickness(0, 0, 0, 20);
myTextBlock.Text = "Scrolling is enabled when it is necessary. Resize the Window, making it larger and smaller.";

Rectangle myRectangle = new Rectangle();
myRectangle.Fill = Brushes.Red;
myRectangle.Width = 500;
myRectangle.Height = 500;

// Add child elements to the parent StackPanel
myStackPanel.Children.Add(myTextBlock);
myStackPanel.Children.Add(myRectangle);
            
// Add the StackPanel as the lone Child of the Border
myScrollViewer.Content = myStackPanel;

// Add the Border as the Content of the Parent Window Object
mainWindow.Content = myScrollViewer;
mainWindow.Show ();


'Define a ScrollViewer.
Dim myScrollViewer As New ScrollViewer
myScrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto

'Add Layout control.
Dim myStackPanel As New StackPanel
myStackPanel.HorizontalAlignment = System.Windows.HorizontalAlignment.Left
myStackPanel.VerticalAlignment = System.Windows.VerticalAlignment.Top

Dim myTextBlock As New TextBlock
myTextBlock.TextWrapping = TextWrapping.Wrap
myTextBlock.Margin = New Thickness(0, 0, 0, 20)
myTextBlock.Text = "Scrolling is enabled when it is necessary. Resize the Window, making it larger and smaller."

Dim myRectangle As New Rectangle
myRectangle.Fill = Brushes.Red
myRectangle.Width = 500
myRectangle.Height = 500

'Add child elements to the parent StackPanel.
myStackPanel.Children.Add(myTextBlock)
myStackPanel.Children.Add(myRectangle)

'Add the StackPanel as the lone Child of the Border
myScrollViewer.Content = myStackPanel
Me.Content = myScrollViewer
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      WindowTitle="ScrollViewer Sample">
  <ScrollViewer HorizontalScrollBarVisibility="Auto">
    <StackPanel VerticalAlignment="Top" HorizontalAlignment="Left">
      <TextBlock TextWrapping="Wrap" Margin="0,0,0,20">Scrolling is enabled when it is necessary. 
      Resize the window, making it larger and smaller.</TextBlock>
      <Rectangle Fill="Red" Width="500" Height="500"></Rectangle>
    </StackPanel>
  </ScrollViewer>
</Page>

설명

이 열거형을 사용 하 여 설정 합니다 HorizontalScrollBarVisibilityVerticalScrollBarVisibility 속성 값을 ScrollViewer 컨트롤.Use this enumeration to set the HorizontalScrollBarVisibility and VerticalScrollBarVisibility property values of the ScrollViewer control.

이 열거형의 멤버 값 지정 ScrollBar 지정 된 방향으로 표시 합니다.The member values of this enumeration specify ScrollBar visibility in a given direction. 이러한 멤버 값을 지정할 수도 있는지 여부를 해당 ScrollViewer 차원이 포함 된 콘텐츠에 적용 됩니다.These member values also specify whether the corresponding ScrollViewer dimension is applied to its enclosed content.

적용 하는 경우는 ViewportWidthViewportHeightScrollViewer 콘텐츠에 대 한 뷰포트 크기를 설정 하면 콘텐츠를 합니다.When you apply the ViewportWidth or ViewportHeight to ScrollViewer content, you set the viewport size for the content.

적용 대상

추가 정보