private void Properties_PropertyClicked(PropertyPage props, ClickType click, int propIdx, int rowIdx, int colIdx) { if (click == ClickType.Button && colIdx == 2) { var src = channelSources[rowIdx]; if (src.type == MidiSourceType.Channel && src.index == 9) { var dlg = new PropertyDialog("MIDI Source", 300, true, true, dialog); dlg.Properties.AddLabel(null, "Channel 10 keys:"); // 0 dlg.Properties.AddCheckBoxList(null, MidiFileReader.MidiDrumKeyNames, GetSelectedChannel10Keys(src)); // 1 dlg.Properties.AddButton(null, "Select All"); // 2 dlg.Properties.AddButton(null, "Select None"); // 3 dlg.Properties.Build(); dlg.Properties.PropertyClicked += MappingProperties_PropertyClicked; dlg.ShowDialogAsync(null, (r) => { if (r == DialogResult.OK) { var keysBool = dlg.Properties.GetPropertyValue <bool[]>(1); src.keys = 0ul; for (int i = 0; i < keysBool.Length; i++) { if (keysBool[i]) { src.keys |= (1ul << i); } } UpdateListView(); } }); } else { PlatformUtils.Beep(); } } }