GoDiagram Web Reference
CreateIcon Method (GoSimpleNode)
Example 

a null value causes no GoNodeIcon to be allocated, but instead a GoDrawing initialized to look like a rectangle.
Create and initialize a GoImage or a GoDrawing to act as the node's icon.
Syntax
'Declaration
 
Protected Overridable Function CreateIcon( _
   ByVal res As ResourceManager, _
   ByVal iconname As String _
) As GoObject
protected virtual GoObject CreateIcon( 
   ResourceManager res,
   string iconname
)

Parameters

res
iconname
a null value causes no GoNodeIcon to be allocated, but instead a GoDrawing initialized to look like a rectangle.

Return Value

a GoNodeIcon that obeys this node's MinimumIconSize and MaximumIconSize properties
Example
If you override this method, you may want the definition to do some of the things that the standard definition does:
protected virtual GoObject CreateIcon(ResourceManager res, String iconname) {
  if (iconname != null) {
    GoNodeIcon ni = new GoNodeIcon();
    if (res != null)
      ni.ResourceManager = res;
    ni.Name = iconname;
    ni.MinimumIconSize = new SizeF(20, 20);
    ni.MaximumIconSize = new SizeF(100, 200);
    ni.Size = ni.MinimumIconSize;
    return ni;
  } else {
    GoDrawing rect = new GoDrawing(GoFigure.Rectangle);
    rect.Selectable = false;
    rect.Resizable = false;
    rect.Size = new SizeF(20, 20);
    return rect;
  }
}
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

GoSimpleNode Class
GoSimpleNode Members

 

 


© 2013. Northwoods Software Corporation. All Rights Reserved.

Send Feedback