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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Symbols from palettes

Thread ID:





18541 Sep 2,2004 06:14 AM UTC Sep 2,2004 05:36 PM UTC WinForms 1
Tags: Diagram
Simon Coates
Asked On September 2, 2004 06:14 AM UTC

Hi, I need to be able to programatically add a symbol from a palette to a diagram. I can do it using the GetChildByName method, but I cannot for the life of me work out how I can control the size of the symbol added. I am sure I am missing a very simple step. Kind regards Simon

Administrator [Syncfusion]
Replied On September 2, 2004 05:36 PM UTC

Hi Simon Here is a sample demonstrating what you are looking for. In this sample, the Triangle symbol from the Palette is added when you run the application. The symbol is resized by changing it''s bounds. Here is the code snippet from the Form''s Load: //New InsertNodesCmd InsertNodesCmd insCmd = new InsertNodesCmd(); //Select the Triangle from the PaletteGroupView this.paletteGroupView1.SelectSymbolModel(this.paletteGroupView1.GroupViewItems[1].Text); SymbolModel symModel = this.paletteGroupView1.SelectedSymbolModel; //new NodeCollection NodeCollection nodes = new NodeCollection(); //Add Symbol to the NodeCollection if (symModel != null) { Symbol triangle = symModel.CreateSymbol(); //Set Size triangle.Bounds = new RectangleF(100,100,200,200); nodes.Add(triangle); } insCmd.Nodes.Concat(nodes); insCmd.Location = new Point(125,125); //Execute the InsertNodesCmd this.diagram1.Controller.ExecuteCommand(insCmd); Regards Arun


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon