The RadialMenuItem class has an ItemClick event. The ItemClick event fires when an item is clicked.
For example the ItemClick event is used like the following:
Visual Basic |
Copy Code
|
---|---|
Private Sub RadialMenu_ItemClick(sender As Object, e As RadialMenuItemClickEventArgs) Select Case TryCast(e.RadialMenuItem.UserData, String) Case "check" e.RadialMenuItem.Checked = Not e.RadialMenuItem.Checked e.RadialMenuItem.Text = If(e.RadialMenuItem.Checked, "ON", "OFF") e.RadialMenuItem.ToolTip = If(e.RadialMenuItem.Checked, "Checked item", "Unchecked item") e.RadialMenuItem.Image = If(e.RadialMenuItem.Checked, Global.RadialMenuTest.Properties.Resources.bullet_ball_glass_red, Global.RadialMenuTest.Properties.Resources.bullet_ball_glass_grey) Exit Select Case "locale" Dim parent As RadialMenuItem = TryCast(e.RadialMenuItem.Parent, RadialMenuItem) If parent IsNot Nothing Then For Each it As RadialMenuItem In parent.Items If DirectCast(it.UserData, String) = "locale" Then it.Checked = False End If Next End If e.RadialMenuItem.Checked = True Exit Select End Select End Sub |
C# |
Copy Code
|
---|---|
private void RadialMenu_ItemClick(object sender, RadialMenuItemClickEventArgs e) { switch (e.RadialMenuItem.UserData as string) { case "check": e.RadialMenuItem.Checked = !e.RadialMenuItem.Checked; e.RadialMenuItem.Text = e.RadialMenuItem.Checked ? "ON" : "OFF"; e.RadialMenuItem.ToolTip = e.RadialMenuItem.Checked ? "Checked item" : "Unchecked item"; e.RadialMenuItem.Image = e.RadialMenuItem.Checked ? global::RadialMenuTest.Properties.Resources.bullet_ball_glass_red : global::RadialMenuTest.Properties.Resources.bullet_ball_glass_grey; break; case "locale": RadialMenuItem parent = e.RadialMenuItem.Parent as RadialMenuItem; if (parent != null) { foreach (RadialMenuItem it in parent.Items) if ((string)it.UserData == "locale") it.Checked = false; } e.RadialMenuItem.Checked = true; break; } } |