I have an idea how to get them all at once:
public static void Example()
{
Dictionary<string, List<string>> dic = new Dictionary<string, List<string>>();
dic.Add(
"first",
new List<string>(new string[] { "first first", "second first" })
);
dic.Add(
"second",
new List<string>(new string[] {
"first second", "second second", "third second"
})
);
List<string> output = new List<string>();
foreach (string key in dic.Keys)
{
output.AddRange(dic[key]);
}
}
For a one-by-one solution, you would need to specify for each button click, which key you meant. Try a
System.Windows.Forms.ListBox
for that.
However, the resulting list will contain keys and values alongside. Unless the keys are formatted in some special way, you won't be able to distinguish one from another anymore.