Exemplo n.º 1
0
        public void m_delSet()
        {
            int index = m_objViewer.m_lvw2.SelectedIndices[0];

            if (MessageBox.Show("确认删除该项吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2) == DialogResult.No)
            {
                return;
            }
            long lngRes = clsDomain.m_lngDelUsageSet(m_objViewer.m_lvw2.SelectedItems[0].SubItems[0].Text.ToString().ToString());

            if (lngRes > 0)
            {
                m_objViewer.m_lvw2.Items.Remove(m_objViewer.m_lvw2.SelectedItems[0]);

                if (m_objViewer.m_lvw2.Items.Count > 0)
                {
                    if (index > 0)
                    {
                        m_objViewer.m_lvw2.Items[index - 1].Selected = true;
                    }
                    else
                    {
                        m_objViewer.m_lvw2.Items[index].Selected = true;
                    }
                }
            }
        }