ProgressBar 類別
TOC
摺疊目錄
展開目錄

ProgressBar Class

代表指出作業進度的控制項,典型的視覺外觀是一列隨著進度進行而動態填滿區域的橫條。

繼承

Object
  DependencyObject
    UIElement
      FrameworkElement
        Control
          RangeBase
            ProgressBar

語法


public class ProgressBar : RangeBase


<ProgressBar .../>

屬性

MarshalingBehaviorAttribute(Agile)
StaticAttribute(Windows.UI.Xaml.Controls.IProgressBarStatics, NTDDI_WIN8)
ThreadingAttribute(Both)
VersionAttribute(NTDDI_WIN8)
WebHostHiddenAttribute()

成員

ProgressBar類別 有這些類型的成員:

建構函式

ProgressBar類別 有這些建構函式。

建構函式說明
ProgressBar Initializes a new instance of the ProgressBar class.

 

事件

ProgressBar類別 有這些事件。

事件說明
DoubleTapped Occurs when an otherwise unhandled DoubleTap interaction occurs over the hit test area of this element. (繼承自 UIElement)
DragEnter Occurs when the input system reports an underlying drag event with this element as the target. (繼承自 UIElement)
DragLeave Occurs when the input system reports an underlying drag event with this element as the origin. (繼承自 UIElement)
DragOver Occurs when the input system reports an underlying drag event with this element as the potential drop target. (繼承自 UIElement)
Drop Occurs when the input system reports an underlying drop event with this element as the drop target. (繼承自 UIElement)
GotFocus Occurs when a UIElement receives focus. (繼承自 UIElement)
Holding Occurs when an otherwise unhandled Hold interaction occurs over the hit test area of this element. (繼承自 UIElement)
IsEnabledChanged Occurs when the IsEnabled property changes. (繼承自 Control)
KeyDown Occurs when a keyboard key is pressed while the UIElement has focus. (繼承自 UIElement)
KeyUp Occurs when a keyboard key is released while the UIElement has focus. (繼承自 UIElement)
LayoutUpdated Occurs when the layout of the visual tree changes. (繼承自 FrameworkElement)
Loaded Occurs when a FrameworkElement has been constructed and added to the object tree, and is ready for interaction. (繼承自 FrameworkElement)
LostFocus Occurs when a UIElement loses focus. (繼承自 UIElement)
ManipulationCompleted Occurs when a manipulation on the UIElement is complete. (繼承自 UIElement)
ManipulationDelta Occurs when the input device changes position during a manipulation. (繼承自 UIElement)
ManipulationInertiaStarting Occurs when the input device loses contact with the UIElement object during a manipulation and inertia begins. (繼承自 UIElement)
ManipulationStarted Occurs when an input device begins a manipulation on the UIElement. (繼承自 UIElement)
ManipulationStarting Occurs when the manipulation processor is first created. (繼承自 UIElement)
PointerCanceled Occurs when a pointer that made contact abnormally loses contact. (繼承自 UIElement)
PointerCaptureLost Occurs when pointer capture previously held by this element moves to another element or elsewhere. (繼承自 UIElement)
PointerEntered Occurs when a pointer enters the hit test area of this element. (繼承自 UIElement)
PointerExited Occurs when a pointer leaves the hit test area of this element. (繼承自 UIElement)
PointerMoved Occurs when a pointer moves while the pointer remains within the hit test area of this element. (繼承自 UIElement)
PointerPressed Occurs when the pointer device initiates a Press action within this element. (繼承自 UIElement)
PointerReleased Occurs when the pointer device that previously initiated a Press action is released, while within this element. (繼承自 UIElement)
PointerWheelChanged Occurs when the delta value of a pointer wheel changes. (繼承自 UIElement)
RightTapped Occurs when a right-tap input stimulus happens while the pointer is over the element. (繼承自 UIElement)
SizeChanged Occurs when either the ActualHeight or the ActualWidth property changes value on a FrameworkElement. (繼承自 FrameworkElement)
Tapped Occurs when an otherwise unhandled Tap interaction occurs over the hit test area of this element. (繼承自 UIElement)
Unloaded Occurs when this object is no longer connected to the main object tree. (繼承自 FrameworkElement)
ValueChanged Occurs when the range value changes. (繼承自 RangeBase)

 

方法

The ProgressBar 類別 有這些方法。 也會繼承來自以下項目的方法 Object 類別.

方法說明
AddHandler Adds a routed event handler for a specified routed event, adding the handler to the handler collection on the current element. Specify handledEventsToo as true to have the provided handler be invoked even if the event is handled elsewhere. (繼承自 UIElement)
ApplyTemplate Loads the relevant control template so that its parts can be referenced. (繼承自 Control)
Arrange Positions child objects and determines a size for a UIElement. Parent objects that implement custom layout for their child elements should call this method from their layout override implementations to form a recursive layout update. (繼承自 UIElement)
ArrangeOverride Provides the behavior for the Arrange pass of layout. Classes can override this method to define their own Arrange pass behavior. (繼承自 FrameworkElement)
CapturePointer Sets pointer capture to a UIElement. Once captured, only the element that has capture will fire pointer-related events. (繼承自 UIElement)
ClearValue Clears the local value of a dependency property. (繼承自 DependencyObject)
FindName Retrieves an object that has the specified identifier name. (繼承自 FrameworkElement)
FindSubElementsForTouchTargeting Enables a UIElement subclass to expose child elements that assist with resolving touch targeting. (繼承自 UIElement)
Focus Attempts to set the focus on the control. (繼承自 Control)
GetAnimationBaseValue Returns any base value established for a dependency property, which would apply in cases where an animation is not active. (繼承自 DependencyObject)
GetTemplateChild Retrieves the named element in the instantiated ControlTemplate visual tree. (繼承自 Control)
GetValue Returns the current effective value of a dependency property from a DependencyObject. (繼承自 DependencyObject)
InvalidateArrange Invalidates the arrange state (layout) for a UIElement. After the invalidation, the UIElement will have its layout updated, which will occur asynchronously. (繼承自 UIElement)
InvalidateMeasure Invalidates the measurement state (layout) for a UIElement. (繼承自 UIElement)
Measure Updates the DesiredSize of a UIElement. Typically, objects that implement custom layout for their layout children call this method from their own MeasureOverride implementations to form a recursive layout update. (繼承自 UIElement)
MeasureOverride Provides the behavior for the Measure pass of the layout cycle. Classes can override this method to define their own Measure pass behavior. (繼承自 FrameworkElement)
OnApplyTemplate Invoked whenever application code or internal processes (such as a rebuilding layout pass) call ApplyTemplate. In simplest terms, this means the method is called just before a UI element displays in your app. Override this method to influence the default post-template logic of a class. (繼承自 FrameworkElement)
OnCreateAutomationPeer When implemented in a derived class, returns class-specific AutomationPeer implementations for the Microsoft UI Automation infrastructure. (繼承自 UIElement)
OnDisconnectVisualChildren Override this method to implement how layout and logic should behave when items are removed from a class-specific content or children property. (繼承自 UIElement)
OnDoubleTapped Called before the DoubleTapped event occurs. (繼承自 Control)
OnDragEnter Called before the DragEnter event occurs. (繼承自 Control)
OnDragLeave Called before the DragLeave event occurs. (繼承自 Control)
OnDragOver Called before the DragOver event occurs. (繼承自 Control)
OnDrop Called before the Drop event occurs. (繼承自 Control)
OnGotFocus Called before the GotFocus event occurs. (繼承自 Control)
OnHolding Called before the Holding event occurs. (繼承自 Control)
OnKeyDown Called before the KeyDown event occurs. (繼承自 Control)
OnKeyUp Called before the KeyUp event occurs. (繼承自 Control)
OnLostFocus Called before the LostFocus event occurs. (繼承自 Control)
OnManipulationCompleted Called before the ManipulationCompleted event occurs. (繼承自 Control)
OnManipulationDelta Called before the ManipulationDelta event occurs. (繼承自 Control)
OnManipulationInertiaStarting Called before the ManipulationInertiaStarting event occurs. (繼承自 Control)
OnManipulationStarted Called before the ManipulationStarted event occurs. (繼承自 Control)
OnManipulationStarting Called before the ManipulationStarting event occurs. (繼承自 Control)
OnMaximumChanged Called when the Maximum property changes. (繼承自 RangeBase)
OnMinimumChanged Called when the Minimum property changes. (繼承自 RangeBase)
OnPointerCanceled Called before the PointerCanceled event occurs. (繼承自 Control)
OnPointerCaptureLost Called before the PointerCaptureLost event occurs. (繼承自 Control)
OnPointerEntered Called before the PointerEntered event occurs. (繼承自 Control)
OnPointerExited Called before the PointerExited event occurs. (繼承自 Control)
OnPointerMoved Called before the PointerMoved event occurs. (繼承自 Control)
OnPointerPressed Called before the PointerPressed event occurs. (繼承自 Control)
OnPointerReleased Called before the PointerReleased event occurs. (繼承自 Control)
OnPointerWheelChanged Called before the PointerWheelChanged event occurs. (繼承自 Control)
OnRightTapped Called before the RightTapped event occurs. (繼承自 Control)
OnTapped Called before the Tapped event occurs. (繼承自 Control)
OnValueChanged Fires the ValueChanged routed event. (繼承自 RangeBase)
ReadLocalValue Returns the local value of a dependency property, if a local value is set. (繼承自 DependencyObject)
ReleasePointerCapture Releases pointer captures for capture of one specific pointer by this UIElement. (繼承自 UIElement)
ReleasePointerCaptures Releases all pointer captures held by this element. (繼承自 UIElement)
RemoveHandler Removes the specified routed event handler from this UIElement. Typically the handler in question was added by AddHandler. (繼承自 UIElement)
SetBinding Attaches a binding to a FrameworkElement, using the provided binding object. (繼承自 FrameworkElement)
SetValue Sets the local value of a dependency property on a DependencyObject. (繼承自 DependencyObject)
TransformToVisual Returns a transform object that can be used to transform coordinates from the UIElement to the specified object. (繼承自 UIElement)
UpdateLayout Ensures that all positions of child objects of a UIElement are properly updated for layout. (繼承自 UIElement)

 

屬性

ProgressBar類別 有這些內容。

屬性存取類型說明

ActualHeight

唯讀Gets the rendered height of a FrameworkElement. (繼承自 FrameworkElement)

ActualWidth

唯讀Gets the rendered width of a FrameworkElement. (繼承自 FrameworkElement)

AllowDrop

讀取/寫入Gets or sets a value that determines whether this UIElement can be a drop target for purposes of drag-and-drop operations. (繼承自 UIElement)

Background

讀取/寫入Gets or sets a brush that provides the background of the control. (繼承自 Control)

BaseUri

唯讀Gets a Uniform Resource Identifier (URI) that represents the base Uniform Resource Identifier (URI) for an XAML-constructed object at XAML load time. This property is useful for Uniform Resource Identifier (URI) resolution at run time. (繼承自 FrameworkElement)

BorderBrush

讀取/寫入Gets or sets a brush that describes the border background of a control. (繼承自 Control)

BorderThickness

讀取/寫入Gets or sets the border thickness of a control. (繼承自 Control)

CacheMode

讀取/寫入Gets or sets a value that indicates that rendered content should be cached as a composited bitmap when possible. (繼承自 UIElement)

CharacterSpacing

讀取/寫入Gets or sets the uniform spacing between characters, in units of 1/1000 of an em. (繼承自 Control)

Clip

讀取/寫入Gets or sets the RectangleGeometry used to define the outline of the contents of a UIElement. (繼承自 UIElement)

DataContext

讀取/寫入Gets or sets the data context for a FrameworkElement when it participates in data binding. (繼承自 FrameworkElement)

DefaultStyleKey

讀取/寫入Gets or sets the key that references the default style for the control. (繼承自 Control)

DesiredSize

唯讀Gets the size that this UIElement computed during the measure pass of the layout process. (繼承自 UIElement)

Dispatcher

唯讀Gets the CoreDispatcher that this object is associated with. (繼承自 DependencyObject)

FlowDirection

讀取/寫入Gets or sets the direction in which text and other UI elements flow within any parent element that controls their layout. This property can be set to either LeftToRight or RightToLeft. Setting FlowDirection to RightToLeft on any element sets the alignment to the right, the reading order to right-to-left and the layout of the control to flow from right to left. (繼承自 FrameworkElement)

FocusState

唯讀Gets a value that specifies whether this control has focus, and the mode by which focus was obtained. (繼承自 Control)

FontFamily

讀取/寫入Gets or sets the font used to display text in the control. (繼承自 Control)

FontSize

讀取/寫入Gets or sets the size of the text in this control. (繼承自 Control)

FontStretch

讀取/寫入Gets or sets the degree to which a font is condensed or expanded on the screen. (繼承自 Control)

FontStyle

讀取/寫入Gets or sets the style in which the text is rendered. (繼承自 Control)

FontWeight

讀取/寫入Gets or sets the thickness of the specified font. (繼承自 Control)

Foreground

讀取/寫入Gets or sets a brush that describes the foreground color. (繼承自 Control)

Height

讀取/寫入Gets or sets the suggested height of a FrameworkElement. (繼承自 FrameworkElement)

HorizontalAlignment

讀取/寫入Gets or sets the horizontal alignment characteristics that are applied to a FrameworkElement when it is composed in a layout parent, such as a panel or items control. (繼承自 FrameworkElement)

HorizontalContentAlignment

讀取/寫入Gets or sets the horizontal alignment of the control's content. (繼承自 Control)

IsDoubleTapEnabled

讀取/寫入Gets or sets a value that determines whether the DoubleTapped event can originate from that element. (繼承自 UIElement)

IsEnabled

讀取/寫入Gets or sets a value indicating whether the user can interact with the control. (繼承自 Control)

IsHitTestVisible

讀取/寫入Gets or sets whether the contained area of this UIElement can return true values for hit testing. (繼承自 UIElement)

IsHoldingEnabled

讀取/寫入Gets or sets a value that determines whether the Holding event can originate from that element. (繼承自 UIElement)

IsIndeterminate

讀取/寫入Gets or sets a value that indicates whether the progress bar reports generic progress with a repeating pattern or reports progress based on the Value property.

IsIndeterminateProperty

唯讀Identifies the IsIndeterminate dependency property.

IsRightTapEnabled

讀取/寫入Gets or sets a value that determines whether the RightTapped event can originate from that element. (繼承自 UIElement)

IsTabStop

讀取/寫入Gets or sets a value that indicates whether a control is included in tab navigation. (繼承自 Control)

IsTapEnabled

讀取/寫入Gets or sets a value that determines whether the Tapped event can originate from that element. (繼承自 UIElement)

Language

讀取/寫入Gets or sets localization/globalization language information that applies to a FrameworkElement, and also to all child elements of the current FrameworkElement in the object representation and in UI. (繼承自 FrameworkElement)

LargeChange

讀取/寫入Gets or sets a value to be added to or subtracted from the Value of a RangeBase control. (繼承自 RangeBase)

ManipulationMode

讀取/寫入Gets or sets the ManipulationModes value used for UIElement behavior and interaction with gestures. (繼承自 UIElement)

Margin

讀取/寫入Gets or sets the outer margin of a FrameworkElement. (繼承自 FrameworkElement)

MaxHeight

讀取/寫入Gets or sets the maximum height constraint of a FrameworkElement. (繼承自 FrameworkElement)

Maximum

讀取/寫入Gets or sets the highest possible Value of the range element. (繼承自 RangeBase)

MaxWidth

讀取/寫入Gets or sets the maximum width constraint of a FrameworkElement. (繼承自 FrameworkElement)

MinHeight

讀取/寫入Gets or sets the minimum height constraint of a FrameworkElement. (繼承自 FrameworkElement)

Minimum

讀取/寫入Gets or sets the Minimum possible Value of the range element. (繼承自 RangeBase)

MinWidth

讀取/寫入Gets or sets the minimum width constraint of a FrameworkElement. (繼承自 FrameworkElement)

Name

讀取/寫入Gets or sets the identifying name of the object. When a XAML processor creates the object tree from XAML markup, run-time code can refer to the XAML-declared object by this name. (繼承自 FrameworkElement)

Opacity

讀取/寫入Gets or sets the degree of the object's opacity. (繼承自 UIElement)

Padding

讀取/寫入Gets or sets the padding inside a control. (繼承自 Control)

Parent

唯讀Gets the parent object of this FrameworkElement in the object tree. (繼承自 FrameworkElement)

PointerCaptures

唯讀Gets the set of all captured pointers, represented as Pointer values. (繼承自 UIElement)

Projection

讀取/寫入Gets or sets the perspective projection (3-D effect) to apply when rendering this element. (繼承自 UIElement)

RenderSize

唯讀Gets the final render size of a UIElement. (繼承自 UIElement)

RenderTransform

讀取/寫入Gets or sets transform information that affects the rendering position of a UIElement. (繼承自 UIElement)

RenderTransformOrigin

讀取/寫入Gets or sets the origin point of any possible render transform declared by RenderTransform, relative to the bounds of the UIElement. (繼承自 UIElement)

Resources

讀取/寫入Gets the locally defined resource dictionary. In XAML, you can establish resource items as child object elements of a frameworkElement.Resources property element, through XAML implicit collection syntax. (繼承自 FrameworkElement)

ShowError

讀取/寫入Gets or sets a value that indicates whether the progress bar should use visual states that communicate an Error state to the user.

ShowErrorProperty

唯讀Identifies the ShowError dependency property.

ShowPaused

讀取/寫入Gets or sets a value that indicates whether the progress bar should use visual states that communicate a Paused state to the user.

ShowPausedProperty

唯讀Identifies the ShowPaused dependency property.

SmallChange

讀取/寫入Gets or sets a Value to be added to or subtracted from the Value of a RangeBase control. (繼承自 RangeBase)

Style

讀取/寫入Gets or sets an instance Style that is applied for this object during layout and rendering. (繼承自 FrameworkElement)

TabIndex

讀取/寫入Gets or sets a value that determines the order in which elements receive focus when the user navigates through controls by pressing the Tab key. (繼承自 Control)

TabNavigation

讀取/寫入Gets or sets a value that modifies how tabbing and TabIndex work for this control. (繼承自 Control)

Tag

讀取/寫入Gets or sets an arbitrary object value that can be used to store custom information about this object. (繼承自 FrameworkElement)

Template

讀取/寫入Gets or sets a control template. The control template defines the visual appearance of a control in UI, and is defined in XAML markup. (繼承自 Control)

TemplateSettings

唯讀Gets an object that provides calculated values that can be referenced as TemplateBinding sources when defining templates for a ProgressBar control.

Transitions

讀取/寫入Gets or sets the collection of Transition style elements that apply to a UIElement. (繼承自 UIElement)

Triggers

唯讀Gets the collection of triggers for animations that are defined for a FrameworkElement. Not commonly used. (繼承自 FrameworkElement)

UseLayoutRounding

讀取/寫入Gets or sets a value that determines whether rendering for the object and its visual subtree should use rounding behavior that aligns rendering to whole pixels. (繼承自 UIElement)

Value

讀取/寫入Gets or sets the current setting of the range control, which may be coerced. (繼承自 RangeBase)

VerticalAlignment

讀取/寫入Gets or sets the vertical alignment characteristics that are applied to a FrameworkElement when it is composed in a parent object such as a panel or items control. (繼承自 FrameworkElement)

VerticalContentAlignment

讀取/寫入Gets or sets the vertical alignment of the control's content. (繼承自 Control)

Visibility

讀取/寫入Gets or sets the visibility of a UIElement. A UIElement that is not visible is not rendered and does not communicate its desired size to layout. (繼承自 UIElement)

Width

讀取/寫入Gets or sets the width of a FrameworkElement. (繼承自 FrameworkElement)

 

備註

ProgressBar 控制項會使用下列兩種樣式的其中一種,以視覺方式指出作業的進度: 顯示重複模式的一列,或根據值來填滿的一列。

IsIndeterminate 屬性會決定 ProgressBar 的外觀。將 IsIndeterminate 設定為 true 可顯示重複模式。要用於不定進度的替代控制項是 ProgressRing。將 IsIndeterminate 設定為 false 可根據值來填滿此列。當 IsIndeterminatefalse 時,您會指定具有 MinimumMaximum 屬性的範圍。根據預設,Minimum 是 0, 而 Maximum 則是 1。若要指定進度值,可設定 Value 屬性。

範例

下列範例示範以值為基礎的 ProgressBar 以及不定的 ProgressBar


<StackPanel x:Name="LayoutRoot" >
  <Border BorderThickness="5" BorderBrush="Black">
    <StackPanel Background="LightGray">
      <TextBlock HorizontalAlignment="Center" Margin="10" 
        Text="Value-Based Progress Bar" />
      <ProgressBar x:Name="pg1" Value="100"  Margin="10" Maximum="200" 
        Height="15" IsIndeterminate="False" />
    </StackPanel>
  </Border>
  <Border BorderThickness="5" BorderBrush="Black">
    <StackPanel Background="LightGray">
      <TextBlock HorizontalAlignment="Center" 
        Margin="10" Text="Indeterminate Progress Bar" />
      <ProgressBar x:Name="pg2" Margin="10" Height="15" 
        IsIndeterminate="True"   />
    </StackPanel>
  </Border>
</StackPanel>


需求

最低支援的用戶端

Windows 8 [僅限 Windows 市集應用程式]

最低支援的伺服器

Windows Server 2012 [僅限 Windows 市集應用程式]

命名空間

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

中繼資料

Windows.winmd

另請參閱

RangeBase

 

 

顯示:
© 2016 Microsoft