示例#1
0
        /// <summary>
        /// 修改选中页签的名称
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Tab_Edit_Click(object sender, EventArgs e)
        {
            Control control = this.propertyGrid1.SelectedObject as Control;

            if (control != null && !IsLocked(control))
            {
                if (control.GetType() == typeof(TabPage))
                {
                    string key = this.BillList.SelectedItem.ToString();
                    if (key == "")
                    {
                        return;
                    }
                    int _trantype;
                    _trantype = BillType[this.BillList.SelectedItem.ToString()];
                    FrmTabEdit frm = new FrmTabEdit();
                    frm.m_tabName = control.Name;
                    frm.ShowDialog();
                    string _TabName = frm.m_tabName.Trim();
                    if (_TabName == "")
                    {
                        return;
                    }
                    EditOneTabPageName(_trantype, control.Name, _TabName);
                }

                else
                {
                    MessageBox.Show("选中项不是页签,操作无效!");
                }
            }
            else
            {
                MessageBox.Show("未选中任何项或选中项已锁定,操作无效!");
            }
        }
示例#2
0
        /// <summary>
        /// 修改选中页签的名称
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Tab_Edit_Click(object sender, EventArgs e)
        {
            Control control = this.propertyGrid1.SelectedObject as Control;
            if (control != null && !IsLocked(control))
            {
                if (control.GetType() == typeof(TabPage))
                {
                    string key = this.BillList.SelectedItem.ToString();
                    if (key == "") return;
                    int _trantype;
                    _trantype = BillType[this.BillList.SelectedItem.ToString()];
                    FrmTabEdit frm = new FrmTabEdit();
                    frm.m_tabName = control.Name;
                    frm.ShowDialog();
                    string _TabName = frm.m_tabName.Trim();
                    if (_TabName == "") return;
                    EditOneTabPageName(_trantype, control.Name, _TabName);
                }

                else
                {
                    MessageBox.Show("选中项不是页签,操作无效!");
                }
            }
            else
            {
                MessageBox.Show("未选中任何项或选中项已锁定,操作无效!");
            }
        }