Compartilhar via


Evento Action.BeforeCaptionShow (sistema de 2007)

Ocorre depois que o usuário clicar no ícone marca SMART s e antes do marca SMART menu é exibido.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v9.0 (em Microsoft.Office.Tools.Excel.v9.0.dll)

Sintaxe

Public Event BeforeCaptionShow As BeforeCaptionShowEventHandler

Dim instance As Action
Dim handler As BeforeCaptionShowEventHandler

AddHandler instance.BeforeCaptionShow, handler
public event BeforeCaptionShowEventHandler BeforeCaptionShow

Comentários

Este evento é uma oportunidade de alterar a legenda de marca SMART com base no contexto.

Exemplos

O exemplo de código a seguir demonstra um manipulador para o BeforeCaptionShow evento. O manipulador de eventos modifica a legenda do menu da ação.Este exemplo de código é parte de um exemplo maior fornecido para a classe Action.

Este exemplo é para uma personalização em nível de documento.

Private Sub OpenMessageBox_BeforeCaptionShow(ByVal sender As Object, _
    ByVal e As Microsoft.Office.Tools.Excel.ActionEventArgs) _
    Handles DisplayAddress.BeforeCaptionShow

    Dim clickedAction As Microsoft.Office.Tools.Excel.Action = _
        TryCast(sender, Microsoft.Office.Tools.Excel.Action)

    If clickedAction IsNot Nothing Then
        clickedAction.Caption = "Display the address of " & e.Text
    End If
End Sub
void DisplayAddress_BeforeCaptionShow(object sender, 
    Microsoft.Office.Tools.Excel.ActionEventArgs e)
{
    Microsoft.Office.Tools.Excel.Action clickedAction =
        sender as Microsoft.Office.Tools.Excel.Action;

    if (clickedAction != null)
    {
        clickedAction.Caption = "Display the address of " +
            e.Text;
    }
}

Permissões

Consulte também

Referência

Action Classe

Membros Action

Namespace Microsoft.Office.Tools.Excel