Profile Picture

NTextShape Double click and type text

Posted By Steve Warner 11 Years Ago
Author
Message
Nevron Support
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

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



Steve Warner
Posted 11 Years Ago
View Quick Profile
Junior Member

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
Last Active: 10 Years Ago
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
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

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
Posted 11 Years Ago
View Quick Profile
Junior Member

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
Last Active: 10 Years Ago
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.



Similar Topics


Reading This Topic