private void AddGroup(object sender, EventArgs e) { var newGroup = new Visgroup { ID = GetNewID(), Colour = Colour.GetRandomLightColour(), Name = "New Group", Visible = true }; _visgroups.Add(newGroup); UpdateVisgroups(); VisgroupPanel.SetSelectedVisgroup(newGroup.ID); GroupName.SelectAll(); GroupName.Focus(); }
private void button1_Click(object sender, RoutedEventArgs e) { string strGroupName = GroupName.Text; string strTextBox1 = textBox1.Text; if (string.IsNullOrEmpty(strGroupName)) { MessageBox.Show("请输入群组名!"); GroupName.Focus(); return; } else if (string.IsNullOrEmpty(strTextBox1)) { MessageBox.Show("请输入群组信息!"); textBox1.Focus(); return; } else { MessageBox.Show("恭喜您修改成功 "); } }