Udostępnij za pośrednictwem


CustomTaskPane.VisibleChanged Event (2007 System)

Occurs when the user displays or closes the custom task pane, or when code changes the value of the Visible property.

Namespace:  Microsoft.Office.Tools
Assembly:  Microsoft.Office.Tools.Common.v9.0 (in Microsoft.Office.Tools.Common.v9.0.dll)

Syntax

'Declaration
Public Event VisibleChanged As EventHandler
'Usage
Dim instance As CustomTaskPane 
Dim handler As EventHandler 

AddHandler instance.VisibleChanged, handler
public event EventHandler VisibleChanged
public:
 event EventHandler^ VisibleChanged {
    void add (EventHandler^ value);
    void remove (EventHandler^ value);
}
JScript does not support events.

Remarks

Applications in the 2007 Microsoft Office system do not provide a default UI for users to display custom task panes. If you create a custom task pane in your add-in, you should also create a UI element, such as a button, that users can click to display or hide your custom task pane. For more information, see Custom Task Panes Overview.

Examples

The following code example demonstrates an event handler for the VisibleChanged event. This event handler updates the state of a toggle button on the Ribbon whenever the user opens or closes the custom task pane. This code example is part of a larger example provided in Walkthrough: Synchronizing a Custom Task Pane with a Ribbon Button.

Private Sub taskPaneValue_VisibleChanged(ByVal sender As Object, _
    ByVal e As System.EventArgs) Handles taskPaneValue.VisibleChanged

    Globals.Ribbons.ManageTaskPaneRibbon.ToggleButton1.Checked = taskPaneValue.Visible
End Sub
private void taskPaneValue_VisibleChanged(object sender, System.EventArgs e)
{
    Globals.Ribbons.ManageTaskPaneRibbon.toggleButton1.Checked = 
        taskPaneValue.Visible;
}

.NET Framework Security

See Also

Reference

CustomTaskPane Class

CustomTaskPane Members

Microsoft.Office.Tools Namespace