private void domainList_DoubleClick(object sender, EventArgs e) { DomainValue val = (DomainValue)domainList.SelectedItem; PushPinPickerPopup popup = new PushPinPickerPopup(); popup.Location = Cursor.Position; popup.SelectedIndex = val.MarkerIndex; popup.ShowDialog(); val.MarkerIndex = popup.SelectedIndex; domainList.Refresh(); }
private void domainList_DoubleClick(object sender, EventArgs e) { DomainValue val = (DomainValue)domainList.SelectedItem; PopupColorPicker picker = new PopupColorPicker(); picker.Location = Cursor.Position; picker.Color = Color.FromArgb(val.MarkerIndex); if (picker.ShowDialog() == DialogResult.OK) { val.MarkerIndex = picker.Color.ToArgb(); } domainList.Refresh(); }
private void listBox1_DrawItem(object sender, DrawItemEventArgs e) { DomainValue value = (DomainValue)domainList.Items[e.Index]; e.DrawBackground(); e.Graphics.DrawString(value.Text, UiTools.StandardRegular, UiTools.StadardTextBrush, new PointF(e.Bounds.X + 2, e.Bounds.Y + 8)); PushPin.DrawAt(e.Graphics, value.MarkerIndex, e.Bounds.X + 220, e.Bounds.Y + 2); if ((e.State & DrawItemState.Selected) == DrawItemState.Selected) { Rectangle rect = e.Bounds; rect.Inflate(-1, -1); e.Graphics.DrawRectangle(Pens.Yellow, rect); } if ((e.State & DrawItemState.Focus) == DrawItemState.Focus) { e.DrawFocusRectangle(); } }
private void listBox1_DrawItem(object sender, DrawItemEventArgs e) { if (e.Index > -1) { DomainValue value = (DomainValue)domainList.Items[e.Index]; e.DrawBackground(); e.Graphics.DrawString(value.Text, UiTools.StandardRegular, UiTools.StadardTextBrush, new PointF(e.Bounds.X + 2, e.Bounds.Y + 8)); Brush backGround = new SolidBrush(Color.FromArgb(value.MarkerIndex)); e.Graphics.FillRectangle(backGround, new Rectangle(e.Bounds.X + 220, e.Bounds.Y + 2, 34, 34)); backGround.Dispose(); if ((e.State & DrawItemState.Selected) == DrawItemState.Selected) { Rectangle rect = e.Bounds; rect.Inflate(-1, -1); e.Graphics.DrawRectangle(Pens.Yellow, rect); } if ((e.State & DrawItemState.Focus) == DrawItemState.Focus) { e.DrawFocusRectangle(); } } }