共用方式為


Expander.Expanded 事件

定義

當開啟 Expander 控制項的內容視窗以顯示其標頭及內容時,就會發生這種情況。

public:
 event System::Windows::RoutedEventHandler ^ Expanded;
public event System.Windows.RoutedEventHandler Expanded;
member this.Expanded : System.Windows.RoutedEventHandler 
Public Custom Event Expanded As RoutedEventHandler 

事件類型

範例

下列範例示範如何指定事件的事件處理常式 Expanded

yourExpander.Expanded += new RoutedEventHandler(expanderHasExpanded);
AddHandler yourExpander.Expanded, AddressOf expanderHasExpanded
<Expander Name ="yourExpander" Expanded="expanderHasExpanded" 
          Header ="expanderTitle" Content="expanderContent"/>

下列範例示範如何定義事件處理常式。

private void expanderHasExpanded(object sender, RoutedEventArgs args)
{
    //Do something when the Expander control expands
}
Private Sub expanderHasExpanded(ByVal sender As Object, ByVal args As RoutedEventArgs)
    'Do something when the Expander control expands
End Sub

備註

當 屬性從 false 變更為 trueIsExpanded ,就會發生此 Expanded 事件。

路由事件資訊

識別碼欄位 ExpandedEvent
路由策略 鼓 泡
代理人 RoutedEventHandler

適用於

另請參閱