Implementing SplitButton in my control.

Hey, I am having problems using the SplitButton ( http://wyday.com/blog/2007/splitbutton- ... -aic-test/ ) in my control. I guess the main problem is that I don't know where to start. 🙁 Can you explain step by step how to do it? Sorry for wasting your time. 🙄

Oh don't worry. I got it to work by dragging /bin/Release/SplitButton.dll to my toolbox. And dragged it to the form, but it shows up like a normal button. (I am a bit n00by.)

Oh don't worry. I got it to work by dragging /bin/Release/SplitButton.dll to my toolbox. And dragged it to the form, but it shows up like a normal button. (I am a bit n00by.)

Well, it is a normal button until you add a menu to it. There are two different menu types you can add to the SplitButton: ContextMenuStrip or ContextMenu. First drag one of them to your form:

[attachment=2]step1.png[/attachment]

Next, add sub-items to the context menu:

[attachment=1]step2.png[/attachment]

Lastly, you need to associated the menu with your SplitButton. Click your SplitButton and in the properties window set either the 'SplitMenu' or the SplitMenuStrip property. (Depending on whether you used the ContextMenu or the ContextMenuStrip):

[attachment=0]step3.png[/attachment]

Tell me if you need any more help.

-Wyatt

Hi Wyatt, i wonder if you could give me a hand on this because i'm having a very hard time trying to put things together. I just can't join the split button into my form. I'm working on SharpDevelop. I've created references, the button now appears in the "Custom components" sections at the tools panel, but it doesn't allow me to drag it into my form. What is it that i'm doing wrong? Hope you can help me, thanks for your time.

Hi Wyatt, i wonder if you could give me a hand on this because i'm having a very hard time trying to put things together. I just can't join the split button into my form. I'm working on SharpDevelop. I've created references, the button now appears in the "Custom components" sections at the tools panel, but it doesn't allow me to drag it into my form. What is it that i'm doing wrong? Hope you can help me, thanks for your time.

Well, first of all I haven't done any testing with SharpDevelop. You might want to try Visual C# Express ( http://www.microsoft.com/express/vcsharp/ ), it's free.

Secondly, you can't drag the menus to the form. The context menu & main menu components will always be in the "custom components" area. If you select one of them, the menu editor should appear on the form (at least for MS Visual Studio & MS Visual C# Express). From there you can edit the menu items.

Then, to add the menu to the button, set either the SplitMenu or the SplitMenuStrip properties to the new menu name.

Tell me if you need any other help.