NTextShape Double click and type text


Author
Message
Steve Warner
Steve Warner
Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)
Group: Forum Members
Posts: 15, Visits: 1
When creating a NTextShape on a diagram, we always replace the text with "DEFAULT" and disable the ability to double-click the shape and type your text (We want to handle the text in the shape via the tag) Is there a way to make the NTextShape never show the "Double click and type text" text? It is confusing to our users.
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Hi,

From your description it appears that you are using the create text shape tool to create text shapes. If that's the case you can create a class that inherits NDiagramElementFactory and assign it to the ElementFactory property of the drawing view. All you have to do in your custom element factory class is to override the CreateText method like this:

public override NTextShape CreateText(bool preview)

{

    return new NTextShape();

}



Best Regards,
Nevron Support Team


Steve Warner
Steve Warner
Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)
Group: Forum Members
Posts: 15, Visits: 1
When I do that, the preview box no longer shows. My users need the box to show. I would like to override the preview text though.
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Then simply set the text you want to the text shape:

public override NTextShape CreateText(bool preview)

{

    NTextShape textShape = new NTextShape();

    textShape.Text = "Your text here";

    return textShape;

}



Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search