Occurs before an
AnnObjectBase is about to be changed.
Syntax
Example
This example will prevent changing the stroke of all annotation objects.
Visual Basic | Copy Code |
---|
Private Sub AnnAutomation_BeforeObjectChanged(ByVal manager As AnnAutomationManager)
For Each automation As AnnAutomation In manager.Automations
AddHandler automation.BeforeObjectChanged, AddressOf automation_BeforeObjectChanged
Next automation
End Sub
Private Sub automation_BeforeObjectChanged(ByVal sender As Object, ByVal e As AnnBeforeObjectChangedEventArgs)
If e.ChangeType = AnnObjectChangedType.Stroke Then
e.Cancel = True
End If
End Sub |
C# | Copy Code |
---|
private void AnnAutomation_BeforeObjectChanged(AnnAutomationManager manager) { // subscribe to the BeforeObjectChanged of all automations foreach(AnnAutomation automation in manager.Automations) automation.BeforeObjectChanged += new EventHandler<AnnBeforeObjectChangedEventArgs>(automation_BeforeObjectChanged); } private void automation_BeforeObjectChanged(object sender, AnnBeforeObjectChangedEventArgs e) { // prevent changing the stroke if(e.ChangeType == AnnObjectChangedType.Stroke) e.Cancel = true; } |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Vista, and Windows Server 2003 family
See Also