# Customize Node Appearance

## Content

Nodes are the primary visual elements. Users can modify color, text, and shape by using the <span class="code" spellcheck="false" data-prosemirror-content-type="mark" data-prosemirror-mark-name="code">C1.Diagram.Shape</span> enumeration.

### **Available Node Shapes:**

* <span class="code" spellcheck="false" data-prosemirror-content-type="mark" data-prosemirror-mark-name="code">Shape.None</span>
* <span class="code" spellcheck="false" data-prosemirror-content-type="mark" data-prosemirror-mark-name="code">Shape.Rectangle</span>
* <span class="code" spellcheck="false" data-prosemirror-content-type="mark" data-prosemirror-mark-name="code">Shape.RoundedRectangle</span>
* <span class="code" spellcheck="false" data-prosemirror-content-type="mark" data-prosemirror-mark-name="code">Shape.Circle</span>
* <span class="code" spellcheck="false" data-prosemirror-content-type="mark" data-prosemirror-mark-name="code">Shape.Ellipse</span>
* <span class="code" spellcheck="false" data-prosemirror-content-type="mark" data-prosemirror-mark-name="code">Shape.Rhombus</span>
* <span class="code" spellcheck="false" data-prosemirror-content-type="mark" data-prosemirror-mark-name="code">Shape.Diamond</span>
* <span class="code" spellcheck="false" data-prosemirror-content-type="mark" data-prosemirror-mark-name="code">Shape.Hexagon</span>
* <span class="code" spellcheck="false" data-prosemirror-content-type="mark" data-prosemirror-mark-name="code">Shape.Octagon</span>
* <span class="code" spellcheck="false" data-prosemirror-content-type="mark" data-prosemirror-mark-name="code">Shape.House</span>

To change node appearance in **Unbound mode**, use the following code:

```csharp
var dummyNode = new Node() 
{ 
    Text = "Execute", 
    Shape = Shape.RoundedRectangle 
};
```

To change node appearance in **Data-Bound mode**, use the following code:

```auto
// set default shape
diagram.NodeCreated += (sender,args) => e.Node.Shape = Shape.RoundedRectangle;
```

### **Style Nodes in FlexDiagram**

The <span class="code" spellcheck="false" data-prosemirror-content-type="mark" data-prosemirror-mark-name="code">Node</span> class (in the <span class="code" spellcheck="false" data-prosemirror-content-type="mark" data-prosemirror-mark-name="code">C1.Win.Diagram</span> namespace) provides styling options to customize the appearance of nodes. Each node can have its own style, title style, tooltip, and images for both title and content areas. These properties make it easy to visually differentiate elements, convey hierarchy, and improve the overall readability of the diagram.

| Property | Description |
| -------- | ----------- |
| **Style** | Defines the node’s fill color, border color, stroke thickness, and font. |
| **TitleStyle** | <span id="22bccd45-d404-408c-b4e9-0852394fe84d" data-mark-type="annotation" data-mark-annotation-type="inlineComment" data-id="22bccd45-d404-408c-b4e9-0852394fe84d" data-prosemirror-content-type="mark" data-prosemirror-mark-name="annotation">Defines the appearance of the node’s title area and can be combined with the main Style to customize the node’s overall appearance.</span> |
| **Tooltip** | <span id="4c1ea763-9321-4c47-80af-47758fd8aae2" data-mark-type="annotation" data-mark-annotation-type="inlineComment" data-id="4c1ea763-9321-4c47-80af-47758fd8aae2" data-prosemirror-content-type="mark" data-prosemirror-mark-name="annotation">Specifies the text displayed when the pointer hovers over the node.</span> |
| **TitleImage** | Sets or retrieves the image displayed in the title area of the node. |
| **ContentImage** | Sets or retrieves the image displayed in the main content area of the node. |

### <span id="d45c7a04-96a9-499a-9872-2dadb74998de" data-mark-type="annotation" data-mark-annotation-type="inlineComment" data-id="d45c7a04-96a9-499a-9872-2dadb74998de" data-prosemirror-content-type="mark" data-prosemirror-mark-name="annotation">Node Styling Example</span>

<span id="d45c7a04-96a9-499a-9872-2dadb74998de" data-mark-type="annotation" data-mark-annotation-type="inlineComment" data-id="d45c7a04-96a9-499a-9872-2dadb74998de" data-prosemirror-content-type="mark" data-prosemirror-mark-name="annotation">The following example demonstrates how to apply styles, images, and tooltips to a node using the properties available in the </span>**<span id="d45c7a04-96a9-499a-9872-2dadb74998de" data-mark-type="annotation" data-mark-annotation-type="inlineComment" data-id="d45c7a04-96a9-499a-9872-2dadb74998de" data-prosemirror-content-type="mark" data-prosemirror-mark-name="annotation">C1.Win.Diagram</span>**<span id="d45c7a04-96a9-499a-9872-2dadb74998de" data-mark-type="annotation" data-mark-annotation-type="inlineComment" data-id="d45c7a04-96a9-499a-9872-2dadb74998de" data-prosemirror-content-type="mark" data-prosemirror-mark-name="annotation"> namespace.</span>

```csharp
using System;
using System.Drawing;
using C1.Win.Diagram;
using C1.Chart;

namespace DiagramStylingExample
{
    public class NodeStylingDemo
    {
        public void CreateStyledNode(FlexDiagram diagram)
        {
            // Step 1: Define the node style
            var nodeStyle = new ChartStyle()
            {
                StrokeColor = Color.SteelBlue,             // Border color
                FillColor = Color.AliceBlue,               // Background color
                StrokeWidth = 2,                           // Border thickness
                StrokeDashPattern = new float[] { 4, 2 }   // Dashed border pattern
            };

            // Step 2: Define the title style
            var titleStyle = new ChartStyle()
            {
                StrokeColor = Color.Navy,                  // Title border color
                FillColor = Color.LightSkyBlue,            // Title background
                StrokeWidth = 1                            // Title border width
            };

            // Step 3: Load images for title and content
            var titleImage = Image.FromFile("titleIcon.png");     // Image near title text
            var contentImage = Image.FromFile("processIcon.png"); // Image inside content area

            // Step 4: Set tooltip text
            string tooltipText = "This node represents the start of the process.";

            // Step 5: Create and style the node
            var startNode = new Node()
            {
                Text = "Start Process",
                Shape = Shape.RoundedRectangle,
                Style = nodeStyle,               // Apply node style
                TitleStyle = titleStyle,         // Apply title style
                TitleImage = titleImage,         // Assign title image
                ContentImage = contentImage,     // Assign content image
                Tooltip = tooltipText            // Assign tooltip
            };

            // Step 6: Add the node to the diagram
            diagram.Nodes.Add(startNode);
        }
    }
}
```