Downloads  |  Buy

Implementing SplitButton in my control.

Implementing SplitButton in my control.

Postby ZS » October 12th, 2008, 7:07 pm

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. :roll:
ZS
 

Re: Implementing SplitButton in my control.

Postby ZS » October 12th, 2008, 7:20 pm

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.)
ZS
 

Re: Implementing SplitButton in my control.

Postby Wyatt » October 12th, 2008, 10:40 pm

[quote="ZS":sz12o766]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.)[/quote:sz12o766]

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

[attachment=2:sz12o766]
step1.png
step1.png (11.78 KiB) Viewed 11383 times
[/attachment:sz12o766]

Next, add sub-items to the context menu:

[attachment=1:sz12o766]
step2.png
step2.png (4.48 KiB) Viewed 11384 times
[/attachment:sz12o766]

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:sz12o766]
step3.png
step3.png (10.96 KiB) Viewed 11382 times
[/attachment:sz12o766]


Tell me if you need any more help.

-Wyatt
User avatar
Wyatt
Site Admin
 
Posts: 6083
Joined: July 11th, 2007, 10:30 pm
Location: New Hampshire

Re: Implementing SplitButton in my control.

Postby Sheket » May 22nd, 2009, 2:19 pm

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.
Sheket
 

Re: Implementing SplitButton in my control.

Postby Wyatt » May 22nd, 2009, 3:56 pm

[quote="Sheket":zunvo25a]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.[/quote:zunvo25a]

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.
User avatar
Wyatt
Site Admin
 
Posts: 6083
Joined: July 11th, 2007, 10:30 pm
Location: New Hampshire


Return to Open Source Support