Exemplo n.º 1
0
 private void keysToSelect_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (keysToSelect.SelectedIndex >= 0)
     {
         listBoxPairs.Add(new BoxKeyboardPair(KeyToString.convert((System.Windows.Forms.Keys)keysToSelect.SelectedValue), (System.Windows.Forms.Keys)keysToSelect.SelectedValue));
     }
 }
Exemplo n.º 2
0
        public MacroAddControl()
        {
            InitializeComponent();
            System.Windows.Forms.Keys[] keys = Enum.GetValues(typeof(System.Windows.Forms.Keys)).Cast <System.Windows.Forms.Keys>().ToArray();

            foreach (System.Windows.Forms.Keys key in keys)
            {
                comboBoxPairs.Add(new BoxKeyboardPair(KeyToString.convert(key), key));
            }

            keysToSelect.DisplayMemberPath = "_Key";
            keysToSelect.SelectedValuePath = "_Value";
            keysToSelect.ItemsSource       = comboBoxPairs;

            currentKeysToBeAdded.DisplayMemberPath = "_Key";
            currentKeysToBeAdded.SelectedValuePath = "_Value";
            currentKeysToBeAdded.ItemsSource       = listBoxPairs;
        }