Yes, we figured this was the best behavior when we designed it. You can modify the code to show the splitter all the time.
I am creating and assigning context menu dynamically to the SplitButton. I always want to display the splitter. But splitter is only displayed when mouse is hovered on the SplitButton.
I have code as following:
Public Class Main Dim ContextMenu1 As New ContextMenu
Private Sub btnAddMenu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) With ContextMenu1 .MenuItems.Add("&New", New System.EventHandler(AddressOf btnAdd_Click)) .MenuItems.Add("&Edit", New System.EventHandler(AddressOf btnEdit_Click)) .MenuItems.Add("&Remove", New System.EventHandler(AddressOf btnRemove_Click)) End With SplitButton1.SplitMenu = ContextMenu1 'SplitButton1.ContextMenu = ContextMenu1 SplitButton1.ShowSplit = True End SubEnd Class
Yes, we figured this was the best behavior when we designed it. You can modify the code to show the splitter all the time.
@samI tried changing some code but it didn't worked. Can you please suggest where and what should I change in the source?
I just realized that SplitButton.ShowSplit is slightly different thing than what I had assumed and its value is by-default True. So, it is of no use in my above code. I had tried changing some "ShowSplit" lines in source code but now I think it is not directly related to what I want.
So, please tell me where the code should be altered to achieve my desired effect.
Look in the OnPaint method and you'll see how the UI is drawn. Just add breakpoints to understand it all, and then modify it once you've understood it.