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.

Symbols from palettes

Thread ID:

Created:

Updated:

Platform:

Replies:

18541 Sep 2,2004 02:14 AM Sep 2,2004 01:36 PM Windows Forms 1
loading
Tags: Diagram
Simon Coates
Asked On September 2, 2004 02:14 AM

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 01:36 PM

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

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.

;