Gets the current
AnnObject being edited.
Syntax
Visual Basic (Declaration) | |
---|
Public Overridable ReadOnly Property CurrentEditObject As AnnObject |
Visual Basic (Usage) | Copy Code |
---|
Dim instance As AnnAutomation
Dim value As AnnObject
value = instance.CurrentEditObject
|
C# | |
---|
public virtual AnnObject CurrentEditObject {get;} |
Managed Extensions for C++ | |
---|
public: __property virtual AnnObject* get_CurrentEditObject(); |
Return Value
The current
AnnObject being edited; null (Nothing in Visual Basic) if no objects are currently being edited.
Example
This example changes the pen of the object that is currently being edited to a Red pen that has a width of 2 pixels.
Visual Basic | Copy Code |
---|
Public Sub AnnAutomation_ChangePenToBlue(ByVal automation As AnnAutomation)
If Not automation.CurrentEditObject Is Nothing Then
If automation.CurrentEditObject.SupportsPen Then
automation.BeginUndo()
automation.CurrentEditObject.Pen = New AnnPen(Color.Blue, New AnnLength(2, AnnUnit.Pixel))
automation.EndUndo()
automation.Viewer.Invalidate(automation.CurrentEditObject.InvalidRectangle)
End If
End If
End Sub |
C# | Copy Code |
---|
public void AnnAutomation_ChangePenToBlue(AnnAutomation automation) { // check if an object is currently "selected" if (automation.CurrentEditObject != null) { // check if this object supports a pen if (automation.CurrentEditObject.SupportsPen) { // change its pen automation.BeginUndo(); automation.CurrentEditObject.Pen = new AnnPen(Color.Blue, new AnnLength(2, AnnUnit.Pixel)); automation.EndUndo(); automation.Viewer.Invalidate(automation.CurrentEditObject.InvalidRectangle); } } } |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also