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.

OnEnter and OnLeave events for a SymbolLabel

Thread ID:

Created:

Updated:

Platform:

Replies:

19448 Sep 27,2004 03:01 AM Sep 30,2004 03:38 AM Windows Forms 6
loading
Tags: Diagram
James Brock
Asked On September 27, 2004 03:01 AM

I am using a class derived from SymbolLabel. These new labels are being added to a Symbol on my Diagram at run time. I wish to update a grid when the user updates the text of the label. I can override the OnPropertyChanged event of the SymbolLabel but this causes the grid to be updated each time the label text is changed, ie. for each keystroke. It would be much more useful for me to have an OnLeave or OnExit event that I could use when the user has finished updating the text and focuses elsewhere. Is this something that will be implemented in a future release of SyncFusion.Diagram or will I have to implement it myself? Jimski

Administrator [Syncfusion]
Replied On September 27, 2004 10:28 AM

Hi Jimski, You can examine the Model''s PropertyChanged event''s evtArgs to get the necessary information. Here is a code snippet that demonstrates what you are looking for. A MessageBox with the new value for the text of the Label in the Symbol is shown after you change the text of the label: private void diagram1_Model_PropertyChanged(object sender, Syncfusion.Windows.Forms.Diagram.PropertyEventArgs evtArgs) { //Check for the type SymbolLabel if(evtArgs.Node.GetType()== typeof(Syncfusion.Windows.Forms.Diagram.SymbolLabel)) { //Check for the Text property if (evtArgs.PropertyName == "Text") { MessageBox.Show(evtArgs.NewValue.ToString()); } } } Regards Arun

James Brock
Replied On September 28, 2004 03:36 AM

Hi Arun, Thanks for getting back to me so quick. I have tried what you have suggested and put a break within the method. When I update the label text the code never gets called, and hence doesn''t break. Having said that, none of my "Diagram_Model_ events" seem to be working either. Could this be to do with the fact that I am using a Custom SymbolLabel or that I am using a Custom Model? Thanks Jimski

Administrator [Syncfusion]
Replied On September 28, 2004 12:25 PM

Hi Jimski In your custom Model''s PropertyChanged event you need to check for your Custom SymbolLabel type to do what you are seeking. Regards Arun

James Brock
Replied On September 29, 2004 12:44 AM

Hi Arun, After some work on this yesterday, it would appear that the method you used in the first place works when dealing with a brand new diagram. However, when working with one that I have saved it doesn''t. I suspect that there may be an issue with my events not being wired up when I load the saved version. Will investigate further and also try adding them to MyModel class. Thanks again Jimski

Administrator [Syncfusion]
Replied On September 29, 2004 02:36 PM

Hi Jimski Yes, you are correct. Use the Diagram''s PropertyChanged event instead of the Diagram''s Model''s PropertyChanged event. Regards Arun

James Brock
Replied On September 30, 2004 03:38 AM

I have now used the Diagram_PropertyChanged event and it works a treat. Thanks Jimski

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.

;