Пример #1
0
        private void ClientsListMouseDoubleClick(object sender, MouseEventArgs e)
        {
            ListViewItem item = ClientsList.GetItemAt(e.X, e.Y);

            ListViewItem.ListViewSubItem subItem = item.GetSubItemAt(e.X, e.Y);
            editElemPanel.Visible  = true;
            editElemPanel.Location = new Point(0, subItem.Bounds.Y + 1 + ClientsList.TopItem.Bounds.Top);
            currentValue           = subItem.Text;
            currentTarget          = ClientsList.Columns[item.SubItems.IndexOf(subItem)].Text;
            editValueTextBox.Mask  = string.Empty;
            if (currentTarget.Equals("Контактный номер") || currentTarget.Equals("Доп. контактный номер"))
            {
                editValueTextBox.Mask = "0 ( 000 ) 000 - 00 - 00";
            }

            if (currentTarget.Equals("Всего заказов"))
            {
                editValueTextBox.Mask = "000";
            }

            editValueTextBox.Text = currentValue;
            editLabel.Text        = currentTarget;
            editValueTextBox.SelectAll();
            editValueTextBox.Focus();
        }