private void btnOK_Click(object sender, EventArgs e) { listStr.Clear(); for (int i = 0; i < fontListBox.Items.Count; i++) { if (fontListBox.Items[i].ToString() != tip) { listStr.Add(fontListBox.Items[i].ToString()); } } FontService.AddFontList(listStr); DialogResult = DialogResult.OK; }
/// <summary> /// 加载窗体 /// </summary> private void LoadingForm() { List <string> lt = FontService.ReadFontList(); if (lt.Count != 0) { this.fontListBox.Items.AddRange(lt.ToArray()); } AddItem(); string[] fonts = LoadFonts(); this.allFontListBox.Items.AddRange(fonts); this.txtCheckedFont.Text = allFontListBox.Items[0].ToString(); this.txtCheckedFont.Select(); leftMoveBtn.Enabled = CompareFont(txtCheckedFont.Text) && !string.IsNullOrEmpty(txtCheckedFont.Text); }