コード例 #1
0
        public void MoveDown()
        {
            if (QATControls.SelectedIndex != (QATControls.Items.Count - 1))
            {
                RibbonItemListDisplay r1 = (QATControls.SelectedValue as RibbonItemListDisplay);
                RibbonItemListDisplay r2 = (QATControls.Items[QATControls.SelectedIndex + 1] as RibbonItemListDisplay);

                int sel = QATControls.SelectedIndex;

                Object oItem = QATControls.Items.GetItemAt(sel);
                QATControls.Items.RemoveAt(sel);
                QATControls.Items.Insert(sel + 1, oItem);
                QATControls.SelectedIndex = QATControls.Items.IndexOf(oItem);
                QATControls.ScrollIntoView(QATControls.SelectedItem);
                //RibbonItemListDisplay r3 = r1;
                //r1.Icon = r2.Icon;
                //r1.SourceControl = r2.SourceControl;
                //r1.ShowMenuArrow = r2.ShowMenuArrow;
                //r1.Header = r2.Header;
                //r1.ItemName = r2.ItemName;

                //r2.Icon = r3.Icon;
                //r2.Header = r3.Header;
                //r2.SourceControl = r3.SourceControl;
                //r2.ItemName = r3.ItemName;
                //r2.ShowMenuArrow = r3.ShowMenuArrow;
                //QATControls.Items.Remove(r1);
                //QATControls.Items.Remove(r2);
                //QATControls.Items[QATControls.SelectedIndex + 1] = r1;
                //QATControls.Items[QATControls.SelectedIndex] = r2;
            }
        }
コード例 #2
0
 private void btnMoveDown_Click(object sender, RoutedEventArgs e)
 {
     if (QATControls.SelectedIndex != QATControls.Items.Count - 1)
     {
         int    sel   = QATControls.SelectedIndex;
         Object oItem = QATControls.Items.GetItemAt(sel);
         QATControls.Items.RemoveAt(sel);
         QATControls.Items.Insert(sel + 1, oItem);
         QATControls.SelectedIndex = QATControls.Items.IndexOf(oItem);
         QATControls.ScrollIntoView(QATControls.SelectedItem);
     }
 }