wyDay blog  |  Downloads  |  Buy
Support forum
wyDay blog
wyDay Home

Splitter is not displayedLocked

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

Nov 7, '12permalink

Yes, we figured this was the best behavior when we designed it. You can modify the code to show the splitter all the time.

Nov 7, '12permalink

@samI tried changing some code but it didn't worked. Can you please suggest where and what should I change in the source?

Nov 7, '12permalink

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.

Nov 7, '12permalink

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.

Nov 10, '12permalink