Windowsformshost scrollviewer




















A ScrollViewer can only have one child, typically a Panel element that can host a Children collection of elements. The Content property defines the sole child of the ScrollViewer. Physical scrolling is used to scroll content by a predetermined physical increment, typically by a value that is declared in pixels.

Logical scrolling is used to scroll to the next item in the logical tree. Physical scrolling is the default scroll behavior for most Panel elements. WPF supports both types of scrolling. The IScrollInfo interface represents the main scrolling region within a ScrollViewer or derived control.

The interface defines scrolling properties and methods that can be implemented by Panel elements that require scrolling by logical unit, rather than by a physical increment. Casting an instance of IScrollInfo to a derived Panel and then using its scrolling methods provides a useful way to scroll to the next logical unit in a child collection, rather than by pixel increment.

By default, the ScrollViewer control supports scrolling by physical units. For layout controls that natively support logical scrolling, you can still achieve physical scrolling by wrapping the host Panel element in a ScrollViewer and setting the CanContentScroll property to false.

The following code example demonstrates how to cast an instance of IScrollInfo to a StackPanel and use content scrolling methods LineUp and LineDown defined by the interface. The following example creates a ScrollViewer in a window that contains some text and a rectangle. Returns whether serialization processes should serialize the contents of the CommandBindings property on instances of this class. Returns whether serialization processes should serialize the contents of the InputBindings property on instances of this class.

Returns a value that indicates whether serialization processes should serialize the value for the provided dependency property. Returns whether serialization processes should serialize the contents of the Resources property. Returns whether serialization processes should serialize the contents of the Style property.

Returns whether serialization processes should serialize the contents of the Triggers property. Returns a transform that can be used to transform coordinates from the Visual to the specified Visual ancestor of the visual object. Returns a transform that can be used to transform coordinates from the Visual to the specified Visual3D ancestor of the visual object.

Returns a transform that can be used to transform coordinates from the Visual to the specified visual object descendant. Returns a transform that can be used to transform coordinates from the Visual to the specified visual object.

Translates a point relative to this element to coordinates that are relative to the specified element. Simplifies access to the NameScope de-registration method. Reapplies the default style to the current FrameworkElement. Updates the child window's size, visibility, and position to reflect the current state of the element. Enforces that the calling thread has access to this DispatcherObject.

Occurs when the Child property is set. Occurs when the input system reports an underlying drag event with this element as the drag target. Occurs when the input system reports an underlying drag event with this element as the drag origin. Occurs when the input system reports an underlying drag event with this element as the potential drop target. Occurs when the input system reports an underlying drop event with this element as the drop target. Occurs when the value of the Focusable property changes.

Occurs when the input system reports an underlying drag-and-drop event that involves this element. Occurs when this FrameworkElement is initialized. This event coincides with cases where the value of the IsInitialized property changes from false or undefined to true. Occurs when the value of the IsEnabled property on this element changes. Occurs when the value of the IsHitTestVisible dependency property changes on this element.

Occurs when the value of the IsKeyboardFocused property changes on this element. Occurs when the value of the IsKeyboardFocusWithin property changes on this element. Occurs when the value of the IsMouseCaptured property changes on this element. Occurs when the value of the IsMouseDirectlyOver property changes on this element. Occurs when the value of the IsStylusCaptured property changes on this element. Occurs when the value of the IsStylusCaptureWithin property changes on this element.

Occurs when the value of the IsStylusDirectlyOver property changes on this element. Occurs when the value of the IsVisible property changes on this element. Occurs when a layout error, such as a skew or rotation that WindowsFormsHost does not support, is encountered. Occurs when the layout of the various visual elements associated with the current Dispatcher changes. Occurs when a manipulation and inertia on the UIElement object is complete.

Occurs when the input device loses contact with the UIElement object during a manipulation and inertia begins. Occurs when an input device begins a manipulation on the UIElement object.

Occurs when there is a change in the keyboard or mouse button state during a drag-and-drop operation. Occurs when the stylus moves while over the element. The stylus must move while being detected by the digitizer to raise this event, otherwise, PreviewStylusInAirMove is raised instead. Occurs when the cursor is requested to display. This event is raised on an element each time that the mouse pointer moves to a new location, which means the cursor object might need to be changed based on its new position.

Occurs when BringIntoView Rect is called on this element. Occurs when either the ActualHeight or the ActualWidth properties change value on this element. Occurs when the stylus moves over this element. The stylus must move while on the digitizer to raise this event.

Otherwise, StylusInAirMove is raised instead. For a description of this member, see HasFocusWithin. For a description of this member, see KeyboardInputSite. For a description of this member, see TabInto TraversalRequest. Skip to main content. This browser is no longer supported. Download Microsoft Edge More info. Contents Exit focus mode. Please rate your experience Yes No. Any additional feedback? Namespace: System. Integration Assembly: WindowsFormsIntegration. Note WindowsFormsIntegration.

In this article. Gets the rendered height of this element. Inherited from FrameworkElement. Gets the rendered width of this element. Inherited from UIElement. Gets a value that indicates whether at least one touch is captured to this element. Gets a value that indicates whether at least one touch is pressed over this element.

Gets or sets the cursor that displays when the mouse pointer is over this element. Gets or sets the data context for an element when it participates in data binding. Inherited from DependencyObject. Gets the size that this element computed during the measure pass of the layout process. Inherited from DispatcherObject. Gets the window handle of the hosted window. Inherited from HwndHost. Gets a value indicating whether this element has any animated properties.

Gets or sets the suggested height of the element. Gets the collection of input bindings associated with this element. Gets a value indicating whether this element has keyboard focus. Gets a value that indicates whether this element has been loaded for presentation.

Gets a value indicating whether the current size returned by layout measure is valid. Gets a value that indicates whether this instance is currently sealed read-only. Gets an enumerator for logical child elements of this element. Gets or sets the outer margin of an element.

Gets or sets the maximum height constraint of the element. Gets or sets the maximum width constraint of the element. Gets or sets the minimum height constraint of the element. Gets or sets the minimum width constraint of the element. Specifies the size of the desired padding within the hosted Windows Forms control. Gets the logical parent element of this element. Gets a value that uniquely identifies this element.

Gets or sets the final render size of this element. Gets or sets the locally-defined resource dictionary. Gets or sets the style used by this element when it is rendered.

Gets a collection of all stylus plug-in customization objects associated with this element. Gets or sets the tool-tip object that is displayed for this element in the user interface UI.

Gets all touch devices that are captured to this element. Gets all touch devices that are over this element. Gets all touch devices that are over this element or any child elements in its visual tree.

Gets the collection of triggers established directly on this element, or in child elements. Gets or sets the user interface UI visibility of this element. Inherited from Visual.

Gets the number of visual child elements within this element. Gets or sets the offset value of the visual object. Gets the visual tree parent of the visual object. Gets or sets the x-coordinate vertical guideline collection. Gets or sets the y-coordinate horizontal guideline collection.

Gets or sets the width of the element. AddHandler RoutedEvent, Delegate. AddLogicalChild Object. Adds the provided object to the logical tree of this element. AddVisualChild Visual. Defines the parent-child relationship between two visuals. Arrange Rect. ArrangeCore Rect. ArrangeOverride Size. Starts an animation for a specified animated property on this element.

Starts the initialization process for this element. BeginStoryboard Storyboard. Begins the sequence of actions that are contained in the provided storyboard. BeginStoryboard Storyboard, HandoffBehavior. Attempts to bring this element into view, within any scrollable regions it is contained within. BringIntoView Rect. BuildWindowCore HandleRef. Attempts to force capture of the mouse to this element.

Attempts to force capture of the stylus to this element. CaptureTouch TouchDevice. Attempts to force capture of a touch to this element. ClearValue DependencyProperty. ClearValue DependencyPropertyKey. CoerceValue DependencyProperty. DestroyWindowCore HandleRef. Immediately frees any system resources that the object might hold. Dispose Boolean. Indicates that the initialization process for the element is complete.

Equals Object. Returns the common ancestor of two visual objects. FindName String. Finds an element that has the provided identifier name. FindResource Object. Attempts to set focus to this element. GetBindingExpression DependencyProperty. GetLayoutClip Size.

GetTemplateChild String. Inherited from Object. Returns an alternative logical parent for this element if there is no visual parent. GetValue DependencyProperty. GetVisualChild Int Gets a value that indicates whether the sink or one of its contained components has focus.

InputHitTest Point. Invalidates the measurement state layout for the element. InvalidateProperty DependencyProperty. Re-evaluates the effective value for the specified dependency property. IsAncestorOf DependencyObject. Determines whether the visual object is an ancestor of the descendant visual object. IsDescendantOf DependencyObject. Determines whether the visual object is a descendant of the ancestor visual object. Measure Size. MeasureCore Size. MeasureOverride Size. MoveFocus TraversalRequest.

Provides class handling for when an access key that is meaningful for this element is invoked. Supports layout behavior when a child element is resized. OnDrop DragEventArgs. OnInitialized EventArgs. Called when one of the mnemonics access keys for this sink is invoked. OnRender DrawingContext. OnStyleChanged Style, Style. Invoked when the style in use on this element changes, which will invalidate the layout.

OnWindowPositionChanged Rect. The following example shows how to define a ControlTemplate for the ScrollViewer control.

For the complete sample, see Styling with ControlTemplates Sample. Skip to main content. This browser is no longer supported. Download Microsoft Edge More info. Contents Exit focus mode. Please rate your experience Yes No. Any additional feedback? Submit and view feedback for This product This page.



0コメント

  • 1000 / 1000