)
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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to configure WinForms RadialMenu and detect mouse selection in RadialMenuItems?

Platform: WinForms |
Control: RadialMenu |
Published Date: June 10, 2015 |
Last Revised Date: January 8, 2020

Configure the Radialmenu

   To configure RadialMenu control, follow the steps given.

  1. Create a new Windows Forms Application Project in VS IDE through New Project Wizard.
  2. Drop a Radial Menu control in the Form.

 

Drag and drop RadialMenu from toolbox

Figure 1: RadialMenu

  1. The commonly used settings of the Radial Menu control are configured either through the Designer by using the Smart tag or through the Properties window. The following screenshot displays the customization of Radial Menu control through smart tag.

 

Change the RadialMenu properties using smart tag

Figure 2: Radial Menu using smart tag

  1. Add the items in the Radial Menu Collection Editor.

 

Show the RadialMenu Collection Editor window

Figure 3: Radial Menu Collection Editor

 

  1. Mouse selection in the RadialMenuItem can be detected by handling the following events:
  1. Click Event

When mouse selection occurs on RadialMenuItem bounds, the Click event is raised. Refer to the screenshot.

 

Show the RadialMenuItem region

Figure 4: RadialMenuItem region

  1. NextLevelOpening Event

This event is raised when the Next level of the Radial Menu is opened.

 

Show the next level selection region

Figure 5: NextLevel selection region

C#

//Hooks event for a particular RadialMenuItem and triggers event for the RadialMenuItem1.
this.radialMenuItem1.Click += new EventHandler(radialMenuItem1_Click);
//Hooks event for the whole RadialMenuItems.
foreach (Control item in this.radialMenu1.Controls)
{
    if (item is RadialMenuItem)
        item.Click += new EventHandler(item_Click);
}
//Event is triggered when the next level of RadialMenu is opened.
this.radialMenu1.NextLevelOpening += new Syncfusion.Windows.Forms.Tools.NextMenuLevelOpening(this.radialMenu1_NextLevelOpening);
void radialMenuItem1_Click(object sender, EventArgs e)
{
    //This event is triggered when RadialMenuItem1 is clicked.
    MessageBox.Show("RadialMenuItem1 is Clicked");
}       
void item_Click(object sender, EventArgs e)
{
    //Performs mouse click on all the RadialMenu items.
    if(sender is RadialMenuItem)
    MessageBox.Show((sender as RadialMenuItem).Text + " Clicked");
}
private void radialMenu1_NextLevelOpening(object sender, Syncfusion.Windows.Forms.Tools.NextLevelOpening e)
{
    //This event is triggered when the next level is opened by clicking the arrow button.
    MessageBox.Show(e.SelectedItem.Text + " Clicked" );
}

VB

'Hooks event for a particular RadialMenuItem and triggers event for RadialMenuItem1.
AddHandler radialMenuItem1.Click, AddressOf radialMenuItem1_Click
'Hooks event for the whole RadialMenuItems.
For Each item As Control In Me.radialMenu1.Controls
    If TypeOf item Is RadialMenuItem Then
       AddHandler item.Click, AddressOf item_Click
    End If
Next item
'Event gets triggered when the next level of RadialMenu is opened.
AddHandler radialMenu1.NextLevelOpening, AddressOf radialMenu1_NextLevelOpening
Private Sub radialMenuItem1_Click(ByVal sender As Object, ByVal e As EventArgs)
    'This event is triggered when RadialMenuItem1 is clicked.
    MessageBox.Show("RadialMenuItem1 is Clicked")
End Sub
Private Sub item_Click(ByVal sender As Object, ByVal e As EventArgs)
    'Performs mouse click on all the RadialMenu items.
    If TypeOf sender Is RadialMenuItem Then
       MessageBox.Show((TryCast(sender, RadialMenuItem)).Text & " Clicked")
    End If
End Sub
Private Sub radialMenu1_NextLevelOpening(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Tools.NextLevelOpening)
    'This event is triggered when the next level is opened by clicking the arrow button.
    MessageBox.Show(e.SelectedItem.Text & " Clicked")
End Sub

Samples:

C#: http://www.syncfusion.com/downloads/support/directtrac/139533/ze/RadialMenu789131505

VB: http://www.syncfusion.com/downloads/support/directtrac/139533/ze/RadialMenu_VB985245079

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

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

Up arrow icon

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