ChartSheet.ActivateEvent 事件
發生於啟動 Microsoft.Office.Tools.Excel.ChartSheet 時。
命名空間: Microsoft.Office.Tools.Excel
組件: Microsoft.Office.Tools.Excel.v4.0.Utilities (在 Microsoft.Office.Tools.Excel.v4.0.Utilities.dll 中)
Microsoft.Office.Tools.Excel (在 Microsoft.Office.Tools.Excel.dll 中)
語法
'宣告
Event ActivateEvent As ChartEvents_ActivateEventHandler
event ChartEvents_ActivateEventHandler ActivateEvent
範例
下列程式碼範例示範 ActivateEvent 事件的處理常式,這個處理常式在目前的 Microsoft.Office.Tools.Excel.ChartSheet 啟動時會顯示訊息方塊。
Private Sub DisplayWhenActivated()
Globals.Sheet1.Range("A1", "A5").Value2 = 22
Globals.Sheet1.Range("B1", "B5").Value2 = 55
Me.SetSourceData(Globals.Sheet1.Range("A1", "B5"), _
Excel.XlRowCol.xlColumns)
Me.ChartType = Excel.XlChartType.xl3DColumn
End Sub
Sub ChartSheet1_ActivateEvent() Handles Me.ActivateEvent
MsgBox("The chart sheet was was activated.")
End Sub
private void DisplayWhenActivated()
{
Globals.Sheet1.Range["A1", "A5"].Value2 = 22;
Globals.Sheet1.Range["B1", "B5"].Value2 = 55;
this.SetSourceData(Globals.Sheet1.Range["A1", "B5"],
Excel.XlRowCol.xlColumns);
this.ChartType = Excel.XlChartType.xl3DColumn;
this.ActivateEvent +=
new Excel.ChartEvents_ActivateEventHandler(
ChartSheet1_ActivateEvent);
}
void ChartSheet1_ActivateEvent()
{
MessageBox.Show("The chart sheet was was activated.");
}
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。