Dave Matney
Dave Matney

Reputation: 97

How to use the drop side of DropButtons?

I'm having the hardest time using the dropdown list side of Krypton Dropbuttons -- specifically, I don't know how to register that I've actually selected something within the dropdown list.

In my project, I am using a dropbutton to apply a change over time, where simply clicking is immediate and the drop list has various increments of time -- I am using tweener-dotnet for the value change over time, as my calculus is awful and why reinvent the wheel?.

I am able to use the dropbutton as a regular button just fine. In addition to that, I've been able to set my ContextMenu in the dropbutton, so when I build the solution and click on the dropdown arrow, the list shows up. What I can't do, however, is figure out how to tell the code that I've actually selected something within the dropdown list.

I've spent a couple hours, collectively, staring at all three iterations of the DropButton examples, and none of them actually show what I'm looking for (seriously, Component Factory?!).

How do I use the dropdown side of the Krypton Dropbutton?

(For open source sake, I may just go back to a regular dropdown list and a regular button, but I really like the simplicity of the Krypton DropButton, and open source isn't really a priority with this project.)

Upvotes: 1

Views: 1257

Answers (3)

Roberto Bonini
Roberto Bonini

Reputation: 7303

Update 2018: the toolkit has been opensourced here: https://github.com/ComponentFactory/Krypton

Component factory hasn't been actively worked on since 2011. Its still closed source so that is an issue.

The Krypton Toolkit itself is a bit iffy in .net 4 and above. The KryptonContextMenu that you need with the KryptonDropButton is one of the bits that I've been having difficulty getting to work.

Upvotes: -3

Dano
Dano

Reputation: 46

I'm about a year and a half late, but here's a radiobutton click event.

Just select the control and event at the top of the IDE.

Public Sub KryptonContextMenuRadioButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles KryptonContextMenuRadioButton1.Click

'do something

End Sub

Upvotes: 0

Joel
Joel

Reputation: 7569

I know that this is late, but I've been dealing with something similar.

For a KryptonDropButton you need to create a KryptonContextMenu, as @Roberto has stated.

Then I went to add a listener to the manu items that I've added to the assigned KryptonContextMenu and found out that the designer does not support the Name property (or maybe I was too blind to find it).

Anyway, I navigated to the designer file I found that those menu items were generated anyway, with default names.

Something like this:

enter image description here

I then went to rename those and added events like I would normally to respond to user selection, but I won't hide that this is overkill.

Upvotes: 2

Related Questions