Their SplitButton is a bit braindead, IMO. Most SplitButton
s treat the arrow area as a virtual button and either skip issuing the Button CLick event or Show the associated drop down menu instead (or both). Most use a new SplitClicked event when that area is clicked so you can fiddle with the menu as needed:
Protected Overrides Sub OnMouseDown(ByVal mevent As MouseEventArgs)
...
' they clicked in the arrow.split rect
If (SplitRect.Contains(mevent.Location)) Then
' notify them
RaiseEvent SplitClick(Me, New EventArgs)
' open the menu if there is one
If ShowContextMenuStrip() = False Then
skipNextClick = True ' fixup for the menu
End If
Else
' let the normal event get raised
State = PushButtonState.Pressed
MyBase.OnMouseDown(mevent)
End If
End Sub
They have no similar event, but as a workaround, you can use the DropDownOpening
event to "cancel" the button click event like so (this works because the DropDownOpening event always fires first):
' workaround flag
Private IgnoreClickBecauseMenuIsOpening As Boolean
Private Sub RadSplitButton1_DropDownOpening(sender As Object,
e As EventArgs) Handles RadSplitButton1.DropDownOpening
IgnoreClickBecauseMenuIsOpening = True
' code to modify menu (or not)
End Sub
Private Sub RadSplitButton1_Click(sender As Object,
e As EventArgs) Handles RadSplitButton1.Click
' ignore click if menu is opening
If IgnoreClickBecauseMenuIsOpening Then
' reset flag
IgnoreClickBecauseMenuIsOpening = False
Exit Sub ' all done here
End If
' normal code to execute for a click
End Sub