GoDiagram Web Reference
CreateText Method
Example 

Create and initialize a text item given a string.
Syntax
'Declaration
 
Public Overridable Function CreateText( _
   ByVal s As String, _
   ByVal idx As Integer _
) As GoText
public virtual GoText CreateText( 
   string s,
   int idx
)

Parameters

s
idx

Return Value

a GoText object that is the new item
Remarks
Note that the width of the text object is not set unless ItemWidth is a positive value.
Example
If you override this method, you may want the definition to do some of the things that the standard definition does:
public virtual GoText CreateText(String s, int idx) {
  GoText t = new GoText();
  t.Selectable = false;
  t.Alignment = GoObject.Middle;
  t.Multiline = true;
  t.BackgroundOpaqueWhenSelected = true;
  t.BackgroundColor = Color.LightBlue;
  t.DragsNode = true;
  t.Text = s;
  t.Wrapping = true;
  if (this.ItemWidth > 0) {
    t.WrappingWidth = this.ItemWidth;
    t.Width = this.ItemWidth;
  }
  return t;
}
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

GoMultiTextNode Class
GoMultiTextNode Members

 

 


© 2013. Northwoods Software Corporation. All Rights Reserved.

Send Feedback