private void FrmAddUser_Load(object sender, EventArgs e) { this.ComboBoxPrivilege.Items.AddRange(PrivilegeLevel.ToArray()); if (WorkingState.Add == this.WorkingState) { this.Text = "添加"; this.ComboBoxPrivilege.SelectedIndex = 0; } else if (WorkingState.Modify == this.WorkingState) { this.Text = "修改"; this.TxtBoxUserName.Text = this.User.Name; this.TxtBoxUserName.Enabled = false; this.TxtBoxPassword.Text = this.User.Password; this.TxtBoxNickname.Text = this.User.Nickname; this.ComboBoxPrivilege.Text = this.User.Privilege; } }