LEADTOOLS Annotations (Leadtools.Annotations assembly)
LEAD Technologies, Inc

ShowObjectPropertiesDialog Method

Example 





Opens the object's Properties dialog.
Syntax
public virtual void ShowObjectPropertiesDialog()
'Declaration
 
Public Overridable Sub ShowObjectPropertiesDialog() 
'Usage
 
Dim instance As AnnAutomation
 
instance.ShowObjectPropertiesDialog()
public virtual void ShowObjectPropertiesDialog()
 function Leadtools.Annotations.AnnAutomation.ShowObjectPropertiesDialog()
public:
virtual void ShowObjectPropertiesDialog(); 
Remarks
Call the CanShowObjectPropertiesDialog property to determine whether the object's Properties dialog can be displayed at this time. The dialog used is AnnAutomationManager.ObjectPropertiesDialogType. If the value of AnnAutomationManager.ObjectPropertiesDialogType is null (Nothing in Visual Basic), this method will not do anything.
Example
 
Public Sub AnnAutomation_ShowObjectPropertiesDialog(ByVal automation As AnnAutomation)
   ' first add a new object to the automation
   Dim rectObj As AnnRectangleObject = New AnnRectangleObject()
   rectObj.Bounds = New AnnRectangle(100, 100, 100, 100, AnnUnit.Pixel)
   rectObj.Pen = New AnnPen(Color.Blue, New AnnLength(1, AnnUnit.Pixel))
   rectObj.Brush = New AnnSolidBrush(Color.Yellow)
   automation.Container.Objects.Add(rectObj)
   automation.Viewer.Invalidate(rectObj.InvalidRectangle)
   ' make sure no objects are selected in the automation
   automation.SelectNone()

   ' show the object properties dialog (this should show a message informing you that no objects are currently selected (bring edited)
   ShowProperties(automation)

   ' select (edit) the object we have just added
   automation.StartEditing(rectObj, False)

   ' show the object properties dialog (should show the object properties dialog)
   ShowProperties(automation)
End Sub

Private Sub ShowProperties(ByVal automation As AnnAutomation)
   ' check if we can show the dialog
   If automation.CanShowObjectPropertiesDialog Then
      automation.ShowObjectPropertiesDialog()
   Else
      MessageBox.Show("Cannot show the object properties dialog because no object is currently being edited (selected)")
   End If
End Sub
public void AnnAutomation_ShowObjectPropertiesDialog(AnnAutomation automation)
{
   // first add a new object to the automation
   AnnRectangleObject rectObj = new AnnRectangleObject();
   rectObj.Bounds = new AnnRectangle(100, 100, 100, 100, AnnUnit.Pixel);
   rectObj.Pen = new AnnPen(Color.Blue, new AnnLength(1, AnnUnit.Pixel));
   rectObj.Brush = new AnnSolidBrush(Color.Yellow);
   automation.Container.Objects.Add(rectObj);
   automation.Viewer.Invalidate(rectObj.InvalidRectangle);
   // make sure no objects are selected in the automation
   automation.SelectNone();

   // show the object properties dialog (this should show a message informing you that no objects are currently selected (bring edited)
   ShowProperties(automation);

   // select (edit) the object we have just added
   automation.StartEditing(rectObj, false);

   // show the object properties dialog (should show the object properties dialog)
   ShowProperties(automation);
}

private void ShowProperties(AnnAutomation automation)
{
   // check if we can show the dialog
   if(automation.CanShowObjectPropertiesDialog)
      automation.ShowObjectPropertiesDialog();
   else
      MessageBox.Show("Cannot show the object properties dialog because no object is currently being edited (selected)");
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

AnnAutomation Class
AnnAutomation Members

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.