예제 #1
0
        private void AddressListBox_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (this.SelectedIndices.Count != 1)
            {
                return;
            }

            ListViewItem item = this.Items[this.SelectedIndices[0]];

            ListViewItem.ListViewSubItem subitem = item.GetSubItemAt(e.X, e.Y);

            if (subitem == null)
            {
                return;
            }

            _textBox.Size = subitem.Bounds.Size;
            if (subitem.Bounds.Width == item.Bounds.Width)
            {
                for (int x = 1; x < item.SubItems.Count; x++)
                {
                    _textBox.Width -= item.SubItems[x].Bounds.Width;
                }
            }

            _textBox.Text      = subitem.Text;
            _textBox.Location  = subitem.Bounds.Location;
            _textBox.TextAlign = HorizontalAlignment.Center;
            _textBox.Font      = Fonts.UbuntuMono.UbuntuMonoRegular;
            _textBox.Visible   = true;
            _textBox.BringToFront();
            _textBox.Focus();
        }