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. Image for the cookie policy date
close icon

Symbol constrants

Is there a way to limit the vertail reszing of a symbol. For example, I''m adding a predefined symbol to a diagram, and I only want the user to be able to adjust the symbols length. what is a good way to achive this?

4 Replies

MF Meera Fathima Syncfusion Team October 19, 2005 01:57 PM UTC

Hi Tim, You can do this by overriding the Symbol''s OnBoundsChanged() method and within that you can restrict the symbol''s height/width from being modified. Please let me know if you have any queries on this. Thanks, Meera.


TW Tim Wendland October 19, 2005 04:47 PM UTC

thank you Meera, in my symbol class i add the following: Protected Overrides Sub OnBoundsChanged(ByVal e As Syncfusion.Windows.Forms.Diagram.BoundsEventArgs) Me.Height = e.OldBounds.Height Me.X = e.OldBounds.X Me.Y = e.OldBounds.Y End Sub and now the user can not change the height of the symbol... >Hi Tim, > >You can do this by overriding the Symbol''s OnBoundsChanged() method and within that you can restrict the symbol''s height/width from being modified. > >Please let me know if you have any queries on this. > >Thanks, >Meera.


MF Meera Fathima Syncfusion Team October 24, 2005 12:25 PM UTC

Hi Tim, My apologies for the delay in getting back to you on this issue. I misunderstood that you got resolved on this. Me.Height refers to the currently selected node''s height hence setting the old bounds value to the currently selected node causes the symbol''s height remains unchanged. If your intension is to prevent the symbol''s height from being changed beyond some value then kindly look at the following sample code snippet. if(this.Height>150.0F) { Me.Height = evtArgs.OldBounds.Height; Me.X = evtArgs.OldBounds.X; Me.Y = evtArgs.OldBounds.Y; } Please let me know if you have any further questions on this issue. We will be glad to assist. Thanks, Meera.


TW Tim Wendland October 25, 2005 02:55 PM UTC

thank you Meera, my issue is resolved, great job! >Hi Tim, > >My apologies for the delay in getting back to you on this issue. I misunderstood that you got resolved on this. Me.Height refers to the currently selected node''s height hence setting the old bounds value to the currently selected node causes the symbol''s height remains unchanged. If your intension is to prevent the symbol''s height from being changed beyond some value then kindly look at the following sample code snippet. > >if(this.Height>150.0F) > { > Me.Height = evtArgs.OldBounds.Height; > Me.X = evtArgs.OldBounds.X; > Me.Y = evtArgs.OldBounds.Y; > } > >Please let me know if you have any further questions on this issue. We will be glad to assist. > > >Thanks, >Meera.

Loader.
Live Chat Icon For mobile
Up arrow icon