---
description: >-
  This feature allows developers to customize the options available in the
  rating control's right‑click context menu, enabling end users to adjust
  certain properties at runtime.
---

# Right‑Click Context Menu Customization

## Overview

The Right‑Click Context Menu Customization feature provides several properties that enable or disable specific context menu options. By configuring these properties, developers can allow end users to modify settings such as the number of stars, star color, hover color, and empty star color via a simple right‑click interface. This improves interactivity and offers additional customization without modifying the application code.

***

### Key Points

<table><thead><tr><th width="286">Aspect</th><th>Description</th></tr></thead><tbody><tr><td>AllowUserToSetNumberOfStars</td><td>Enables a submenu allowing end users to change the total number of stars displayed.</td></tr><tr><td>AllowUserToChangeStarColor</td><td>Permits users to change the filled star color using a color dialog from the context menu.</td></tr><tr><td>AllowUserToChangeHoverColor</td><td>Allows users to modify the hover color for stars through the context menu.</td></tr><tr><td>AllowUserToChangeEmptyColor</td><td>Enables users to alter the empty star color via the context menu.</td></tr><tr><td>Built‑in Options</td><td>Includes preset options such as “Reset Rating” and “Toggle Read‑Only” to further empower user control.</td></tr></tbody></table>

***

### Best Practices

<table><thead><tr><th width="252">Area</th><th>Guidance</th></tr></thead><tbody><tr><td>Context Menu Minimalism</td><td>Enable only the necessary context menu options to avoid overwhelming end users with too many choices.</td></tr><tr><td>Consistent User Experience</td><td>Ensure that context menu options align with the overall application design and do not conflict with other UI elements.</td></tr><tr><td>Clear Option Labeling</td><td>Use descriptive labels for context menu options so that users understand the effect of each action.</td></tr><tr><td>Testing for Usability</td><td>Test the context menu on various display sizes and resolutions to ensure all options are accessible and usable.</td></tr></tbody></table>

***

### Common Pitfalls

<table><thead><tr><th width="249">Issue</th><th>Description</th></tr></thead><tbody><tr><td>Excessive Options</td><td>Enabling too many context menu options can confuse users and clutter the interface.</td></tr><tr><td>Inconsistent Behavior</td><td>Failing to synchronize context menu settings with the control's other properties may lead to unexpected behavior.</td></tr><tr><td>Poor Visibility</td><td>If context menu options are not clearly labeled or styled, users may have difficulty understanding their purpose.</td></tr><tr><td>Overriding Default Settings</td><td>Custom context menu options may inadvertently override or conflict with built‑in functionalities if not handled properly.</td></tr></tbody></table>

***

### Usage Scenarios

<table data-full-width="false"><thead><tr><th width="284">Scenario</th><th>Explanation</th></tr></thead><tbody><tr><td>Customizable Rating Widgets</td><td>Allow end users to tailor the rating control on-the-fly by modifying star count and color settings via the context menu.</td></tr><tr><td>Interactive Demonstration Tools</td><td>Enable context menu options in demos to showcase the flexibility and customization capabilities of the control.</td></tr><tr><td>User Preference Settings</td><td>Let users personalize the appearance of the rating control according to their preferences, such as star color or hover color.</td></tr><tr><td>Administrative Interfaces</td><td>Provide administrators with tools to quickly adjust the rating control settings without redeploying the application.</td></tr></tbody></table>

***

### Real Life Usage Scenarios

<table><thead><tr><th width="286">Scenario</th><th>Description</th></tr></thead><tbody><tr><td>E-Commerce Applications</td><td>End users can adjust the number of stars in product reviews or change star colors to match personal preferences.</td></tr><tr><td>Service Review Systems</td><td>Allow users to quickly reset or modify ratings using the context menu, enhancing the feedback process.</td></tr><tr><td>Kiosk or Touch Screen Interfaces</td><td>Users can interact directly with the rating control to customize its display, making the interface more engaging.</td></tr><tr><td>Dynamic Survey Tools</td><td>Participants can modify the control’s appearance (e.g., changing hover colors) during surveys to better reflect their choices.</td></tr></tbody></table>

***

### Code Examples

#### Example 1: Enabling Basic Context Menu Options

```csharp
using System;
using System.Drawing;
using System.Windows.Forms;
using SiticoneNetFrameworkUI;

namespace SampleRatingApp
{
    public class MainForm : Form
    {
        public MainForm()
        {
            // Create and configure the rating control with basic context menu options enabled
            var ratingControl = new SiticoneRating
            {
                AllowUserToSetNumberOfStars = true,
                AllowUserToChangeStarColor = true,
                AllowUserToChangeHoverColor = true,
                AllowUserToChangeEmptyColor = true,
                Location = new Point(10, 10)
            };

            Controls.Add(ratingControl);
        }

        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.Run(new MainForm());
        }
    }
}
```

#### Example 2: Customizing Context Menu Options for a Read‑Only Rating Display

```csharp
using System;
using System.Drawing;
using System.Windows.Forms;
using SiticoneNetFrameworkUI;

namespace ReadOnlyRatingApp
{
    public class MainForm : Form
    {
        public MainForm()
        {
            // Create and configure the rating control with limited context menu options for a read-only display
            var ratingControl = new SiticoneRating
            {
                ReadOnly = true,
                AllowUserToSetNumberOfStars = false,  // Disable star count change
                AllowUserToChangeStarColor = false,    // Disable color change options
                AllowUserToChangeHoverColor = false,
                AllowUserToChangeEmptyColor = false,
                Location = new Point(10, 10)
            };

            // Built-in options like "Reset Rating" and "Toggle Read‑Only" will still be available
            Controls.Add(ratingControl);
        }

        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.Run(new MainForm());
        }
    }
}
```

#### Example 3: Combining Context Menu Customization with Interactive Behavior

```csharp
using System;
using System.Drawing;
using System.Windows.Forms;
using SiticoneNetFrameworkUI;

namespace InteractiveRatingApp
{
    public class MainForm : Form
    {
        public MainForm()
        {
            // Create and configure the rating control with full context menu options enabled
            var ratingControl = new SiticoneRating
            {
                AllowHalfStars = true,
                ReadOnly = false,
                AllowUserToSetNumberOfStars = true,
                AllowUserToChangeStarColor = true,
                AllowUserToChangeHoverColor = true,
                AllowUserToChangeEmptyColor = true,
                Location = new Point(20, 20)
            };

            // Subscribe to the RatingChanged event to log changes
            ratingControl.RatingChanged += (sender, e) =>
            {
                Console.WriteLine($"Rating changed from {e.OldValue} to {e.NewValue}");
            };

            Controls.Add(ratingControl);
        }

        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.Run(new MainForm());
        }
    }
}
```

***

### Troubleshooting Tips

<table><thead><tr><th width="325">Issue</th><th>Troubleshooting Steps</th></tr></thead><tbody><tr><td>Context Menu Options Not Appearing</td><td>Verify that at least one context menu property (e.g., AllowUserToSetNumberOfStars) is enabled and that the control is not set to ReadOnly if interaction is expected.</td></tr><tr><td>Inconsistent Behavior of Options</td><td>Ensure that the context menu initialization occurs after the properties are set, and call Invalidate() if necessary to refresh the control.</td></tr><tr><td>Unresponsive Menu Selections</td><td>Check that event handlers for context menu items (such as Reset Rating or Toggle Read‑Only) are correctly attached and functioning.</td></tr><tr><td>Overcrowded Menu Items</td><td>Consider disabling unnecessary context menu options to simplify the interface for end users.</td></tr></tbody></table>

***

### Review

The Right‑Click Context Menu Customization feature offers a convenient way to empower end users with control over the rating component. It enhances interactivity by providing on‑the‑fly customization options while keeping the control flexible and easy to integrate.

<table><thead><tr><th width="229">Aspect</th><th>Review Comment</th></tr></thead><tbody><tr><td>User Empowerment</td><td>Provides end users with the ability to modify key properties such as star count and colors without coding.</td></tr><tr><td>Integration Ease</td><td>Simple property assignments enable quick configuration of context menu options.</td></tr><tr><td>Customization Flexibility</td><td>Allows developers to selectively enable or disable options, ensuring the context menu fits the application's needs.</td></tr><tr><td>Interface Clarity</td><td>Well‑labeled and minimal context menu options contribute to a clean and intuitive user experience.</td></tr></tbody></table>

***

### Summary

The Right‑Click Context Menu Customization feature gives developers the tools to tailor the rating control’s context menu, enhancing user interactivity and customization. By enabling options such as changing the star count and colors, developers can provide a dynamic, user-friendly interface that adapts to varying requirements.

<table><thead><tr><th width="206">Summary Aspect</th><th>Details</th></tr></thead><tbody><tr><td>Core Customization</td><td>Enable or disable context menu options using properties like AllowUserToSetNumberOfStars and color change settings.</td></tr><tr><td>User Interactivity</td><td>Allows end users to customize the rating control at runtime, enhancing overall engagement.</td></tr><tr><td>Integration Ease</td><td>Straightforward property configurations and automatic context menu initialization simplify integration.</td></tr><tr><td>Practical Application</td><td>Ideal for applications requiring user personalization of UI elements such as ratings.</td></tr></tbody></table>

***

### Additional Useful Sections

#### Integration Checklist

<table><thead><tr><th width="299">Checklist Item</th><th>Status/Action Required</th></tr></thead><tbody><tr><td>Enable Desired Menu Options</td><td>Set AllowUserToSetNumberOfStars, AllowUserToChangeStarColor, etc., as needed.</td></tr><tr><td>Test Context Menu Behavior</td><td>Ensure that the menu displays the correct options and that they function as intended.</td></tr><tr><td>Validate with End Users</td><td>Gather user feedback on the context menu’s clarity and usability.</td></tr><tr><td>Synchronize with Other Properties</td><td>Confirm that context menu changes reflect appropriately on the rating control.</td></tr></tbody></table>

#### FAQ

| Question                                                   | Answer                                                                                                                                    |
| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| How do I enable the context menu options?                  | Set the appropriate properties (e.g., AllowUserToSetNumberOfStars, AllowUserToChangeStarColor) to true.                                   |
| Can I customize the built‑in context menu options?         | Yes, the built‑in context menu automatically reflects the enabled properties and includes options like Reset Rating and Toggle Read‑Only. |
| What happens if multiple context menu options are enabled? | All enabled options will be displayed in the right‑click menu; ensure they are clearly labeled to avoid confusion.                        |
| Can I disable the context menu entirely?                   | Yes, by setting all context menu related properties to false, the right‑click menu will only show the default options.                    |

***

This comprehensive documentation should help developers integrate and customize the Right‑Click Context Menu Customization feature effectively, ensuring a flexible, interactive, and user-friendly rating control.
