The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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?
ADAdministrator Syncfusion Team 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.
EREric RobishawMarch 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.
>
>
>
>
ADAdministrator Syncfusion Team 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.
ADAdministrator Syncfusion Team 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.