void menu_down(object sender, System.EventArgs e) { string strError = ""; List <int> indices = null; if (ListViewUtil.MoveItemUpDown(this.ListView, false, out indices, out strError) == -1) { MessageBox.Show(this, strError); return; } if (indices != null && indices.Count >= 2) { Server o = (Server)Servers[indices[0]]; Servers.RemoveAt(indices[0]); Servers.Insert(indices[1], o); Servers.Changed = true; m_bChanged = true; } }
void menu_moveDownColumn_Click(object sender, EventArgs e) { string strError = ""; List <int> indices = null; int nRet = ListViewUtil.MoveItemUpDown(this.listView_columns, false, out indices, out strError); if (nRet == -1) { MessageBox.Show(this, strError); } }
private void toolStripButton_move_down_Click(object sender, EventArgs e) { string strError = ""; List <int> indices = null; ListViewUtil.MoveItemUpDown(this.listView_columns, false, out indices, out strError); // 确保移动后的事项可见 if (this.listView_columns.SelectedItems.Count > 0) { this.listView_columns.SelectedItems[0].EnsureVisible(); } if (string.IsNullOrEmpty(strError) == false) { MessageBox.Show(this, strError); } }