Lachlan Mather
Lachlan Mather

Reputation: 283

Creating a drop-down menu with radio buttons

I am creating a WPF application that has the ability to use different sorting algorithms. Currently, it can only use QuickSort, but I want to implement a functionality that allows the user to click on a drop-down menu, which will then display all the different types of sorting algorithms. When the user selects one, and the 'Sort' button is clicked, it will use that method.

How can I create a drop-down menu with radio buttons as items inside, and only one radio button can be selected at a time?

A rough sketch of what I'd like: sketch

Have done a dig around on Google looking for answers, but all I can find are dead links and/or outdated methods. This stack overflow page is similar to what I'm looking for, however instead of buttons inside the drop-down menu, I'm looking for radio buttons.

Upvotes: 0

Views: 604

Answers (1)

Jakob Busk Sørensen
Jakob Busk Sørensen

Reputation: 6081

As stated by @canton7, use a normal combo box. I would suggest starting out with the simplest possible version, without any fancy visual (like the checkbox in your drawing).

Google "ComboBox WPF" to get started.

Upvotes: 1

Related Questions