We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Select a 2nd SymbolLabel

Thread ID:

Created:

Updated:

Platform:

Replies:

42349 Mar 27,2006 06:20 PM UTC Mar 29,2006 10:18 AM UTC Windows Forms 4
loading
Tags: Diagram
Eric Robishaw
Asked On March 27, 2006 06:20 PM UTC

If I have a symbol with 2+ labels, how do I set the 2nd (or 3rd, etc) label into text edit mode? Or, for that matter, how do you *programatically* set any SymbolLabel (even the first) into edit mode? I.E.: I know that by moving a label up in hierarchy, when the user double clicks a symbol, the 0-indexed symbol label will enter edit mode. How do I do this programatically on any of the labels?

Administrator [Syncfusion]
Replied On March 28, 2006 05:08 AM UTC

Hi, Thanks for your interest in Syncfusion. To programmatically set the text edit mode of the SymbolLabel , the ReadOnly property of the SymbolLabel would be sufficient. Kindly, refer the SymbolFactory Sample( Diagram.Windows\Samples\Symbol Design\SymbolFactory ) in particular the GenerateSymbolModelForShapes()in which the SymbolLabel can be set to text edit mode using the ReadOnly property. If the ReadOnly property is True the Label text cannot be edited and if false the Label text can be edited. Please let me know if you have any queries. Regards, Praveena.

Eric Robishaw
Replied On March 28, 2006 04:25 PM UTC

I think you missed my point(s). 1) If there are 2 labels on a symbol, the user has no way of entering edit mode on the 2nd label. Even if it is not readonly, when dbl clicking on a symbol, only the first (index 0) label is ever entered. 2) I want to *programmatically* enter edit mode. i.e., issue a command that places any label of my choice into edit mode. > > Hi, > > Thanks for your interest in Syncfusion. > > To programmatically set the text edit mode of the SymbolLabel , the ReadOnly property of the SymbolLabel would be sufficient. > > Kindly, refer the SymbolFactory Sample( Diagram.Windows\Samples\Symbol Design\SymbolFactory ) in particular the GenerateSymbolModelForShapes()in which the SymbolLabel can be set to text edit mode using the ReadOnly property. If the ReadOnly property is True the Label text cannot be edited and if false the Label text can be edited. > > Please let me know if you have any queries. > > Regards, > Praveena. > > > >

Administrator [Syncfusion]
Replied On March 29, 2006 09:31 AM UTC

Hi, Thanks for the update. To set the text editmode of the SymbolLabel of your choice ,please refer the following code snippet. MySymbol symbol = new MySymbol(); SymbolLabel symbollabel = new SymbolLabel(); ILabelContainer lblContainer = symbol as ILabelContainer; if (symbollabel != null && !symbollabel .ReadOnly) { if (lblContainer != null) { SizeF maxSize = lblContainer .GetLabelMaxSize(symbollabel); Control parentControl = this.diagram1.Controller.ParentControl; if (parentControl != null) { // TextEdit class implements a text box control for editing the text objects. TextEdit editCtl = new TextEdit(this.diagram1.Controller.View, maxSize, true); this.texteditor = editCtl; //Starts editing the specified node. this.texteditor.BeginEdit(symbollabel); this.texteditor.Focus(); parentControl.Refresh(); } } } Please let me know if this helps you. Regards, Praveena.

Administrator [Syncfusion]
Replied On March 29, 2006 10:18 AM UTC

Hi, I have attached a Sample file that would implement the behaviour you have requested. Thanks for your support to Syncfusion. Please let me know if you have any further queries regarding this. Regards, Praveena.

Labels_EditMode.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;