private void colorLabel_Click(object sender, EventArgs e) { ColorDialog colorDialog = new ColorDialog(); if (colorDialog.ShowDialog() == DialogResult.OK) { colorLabel.Text = Figure.ColorToHexString(colorDialog.Color); errorProvider.SetError(colorLabel, ""); } }
private void SetupControls(Figure figure) { colorLabel.Text = Figure.ColorToHexString(figure.Color); typeListBox.SelectedIndex = GetIndexInListBox(figure.Type.ToString()); string coordinates = figure.Coordinates.Item1 + ";" + figure.Coordinates.Item2; coordinatesTextBox.Text = coordinates; areaTextBox.Text = figure.Area.ToString(); labelTextBox.Text = figure.Label; }
private void UpdateItem(ListViewItem item) { Figure figure = (Figure)item.Tag; while (item.SubItems.Count < 5) { item.SubItems.Add(new ListViewItem.ListViewSubItem()); } item.SubItems[0].Text = Figure.ColorToHexString(figure.Color); item.SubItems[1].Text = figure.Type.ToString(); item.SubItems[2].Text = figure.Coordinates.ToString(); item.SubItems[3].Text = figure.Area.ToString(); item.SubItems[4].Text = figure.Label; }