Hi Nelson,
If your intention is to set the Symbol's label node to Edit mode, then you can achieve this by using the TextEdit .The TextEdit class implements a text box control for editing the text objects.
if(this.diagram1.Controller.SelectionList.Count != 0)
{
MySymbol symbol = this.diagram1.Controller.SelectionList.First as MySymbol;
symbol.EditStyle.AllowMove = false;
SymbolLabel lbl = symbol.GetChildByName("MyLabel") as SymbolLabel;
ILabelContainer lblContainer = symbol as ILabelContainer;
if (lbl != null && !lbl.ReadOnly)
{
if (lblContainer != null)
{
SizeF maxSize = lblContainer.GetLabelMaxSize(lbl);
Control parentControl = this.diagram1.Controller.ParentControl;
if (parentControl != null)
{
TextEdit editCtl = new TextEdit(this.diagram1.Controller.View, maxSize, true);
this.textEditor = editCtl;
// BeginEdit method is used to edit the specified node.
this.textEditor.BeginEdit(lbl);
editCtl.Focus();
parentControl.Refresh();
}
}
}
}
I have created a sample demonstrating this completely. In this sample when you click on File->Rename menuitem you can edit the label. After edit the label you can click File->EndEdit menuitem to end the edit mode.
You can download the sample from the following page.
http://websamples.syncfusion.com/samples/Diagram.Windows/F59761/main.htmPlease refer to the sample and let me know if you have any questions.
Thanks for using Syncfusion product.
Regards,
Nagaraj