Spread Windows Forms 7.0 Product Documentation
AnnotationModeStarting Event
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > FpSpread Class : AnnotationModeStarting Event


Glossary Item Box

Occurs when the user begins annotation mode.

Syntax

Visual Basic (Declaration) 
Public Event AnnotationModeStarting As AnnotationModeStartingEventHandler
Visual Basic (Usage)Copy Code
Dim instance As FpSpread
Dim handler As AnnotationModeStartingEventHandler
 
AddHandler instance.AnnotationModeStarting, handler
C# 
public event AnnotationModeStartingEventHandler AnnotationModeStarting

Event Data

The event handler receives an argument of type AnnotationModeEventArgs containing data related to this event. The following AnnotationModeEventArgs properties provide information specific to this event.

PropertyDescription
Cancel (Inherited from System.ComponentModel.CancelEventArgs) 
DrawingSurface Gets the drawing surface control.

Remarks

This event is raised by the OnAnnotationModeStarting method when the user is changing the active sheet.

For more details on the individual event arguments, refer to AnnotationModeEventArgs members.

Example

This example uses the AnnotationModeStarting event.
C#Copy Code
private void button1_Click(object sender, EventArgs e)
        {
            fpSpread1.StartAnnotationMode(true);
            //fpSpread1.StartAnnotationMode();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            fpSpread1.StopAnnotationMode();
        }

        private void fpSpread1_AnnotationModeStarting(object sender, FarPoint.Win.Spread.AnnotationModeEventArgs e)
        {
            
            e.DrawingSurface.ForeColor = Color.BlueViolet;
            e.DrawingSurface.BackColor = Color.Thistle;
        }

        private void fpSpread1_AnnotationModeEnding(object sender, FarPoint.Win.Spread.AnnotationModeEventArgs e)
        {
            listBox1.Items.Add("Stop Drawing");           
        }
VB.NETCopy Code
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        FpSpread1.StartAnnotationMode(True)
        'FpSpread1.StartAnnotationMode()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        FpSpread1.StopAnnotationMode()
    End Sub

    Private Sub FpSpread1_AnnotationModeStarting(ByVal sender As System.Object, ByVal e As FarPoint.Win.Spread.AnnotationModeEventArgs) Handles FpSpread1.AnnotationModeStarting
        e.DrawingSurface.ForeColor = Color.BlueViolet
        e.DrawingSurface.BackColor = Color.Thistle
    End Sub

    Private Sub FpSpread1_AnnotationModeEnding(ByVal sender As System.Object, ByVal e As FarPoint.Win.Spread.AnnotationModeEventArgs) Handles FpSpread1.AnnotationModeEnding
        ListBox1.Items.Add("Stop Drawing")
    End Sub

Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.