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.

Edit Labels

Thread ID:

Created:

Updated:

Platform:

Replies:

59761 Apr 20,2007 06:08 PM Apr 23,2007 06:51 PM Windows Forms 3
loading
Tags: Diagram
Nelson Druding
Asked On April 20, 2007 06:08 PM

When working with a diagram element, is there any support for editing the label of an element in place? Do you have an example of this?

Thanks.


J.Nagarajan [Syncfusion]
Replied On April 20, 2007 06:41 PM

Hi Nelson,

Thanks for your interest in Syncfusion product. When you double click on the symbol you can edit the Symbol Label in v.4.4.0.51. Please refer to our SimpleFlow sample (C:\Program Files\Syncfusion\Essential Studio\4.4.0.51\Windows\Diagram.Windows\Samples\Symbol Design\SimpleFlow) for more details. In this sample when you double click on a sample you can edit the Label.

Please let me know if you have any questions.

Thanks,
Nagaraj

Nelson Druding
Replied On April 23, 2007 05:30 PM

Thanks Nagara,

Is there anyway of programmaticly forcing this? I want to put a menu item called "Rename" which edits the label. Any ideas?

Thanks,

-Nelsn

>Hi Nelson,

Thanks for your interest in Syncfusion product. When you double click on the symbol you can edit the Symbol Label in v.4.4.0.51. Please refer to our SimpleFlow sample (C:\Program Files\Syncfusion\Essential Studio\4.4.0.51\Windows\Diagram.Windows\Samples\Symbol Design\SimpleFlow) for more details. In this sample when you double click on a sample you can edit the Label.

Please let me know if you have any questions.

Thanks,
Nagaraj

J.Nagarajan [Syncfusion]
Replied On April 23, 2007 06:51 PM

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.htm

Please refer to the sample and let me know if you have any questions.

Thanks for using Syncfusion product.

Regards,
Nagaraj

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.

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.

;