예제 #1
0
        /// <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);
        }
예제 #2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            string[] items = new string[fontListBox.Items.Count];
            this.fontListBox.Items.CopyTo(items, 0);
            FontService.AddFontList(items, tip);
            string fontListString = fontListBox.SelectedItem.ToString();

            if (fontListString == tip)
            {
                fontListString = "";
                if (MessageService.Show(StringParserService.Parse("${res:TextpropertyPanel.fontname.err}"),
                                        MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    DialogResult = DialogResult.OK;
                }
            }
            else
            {
                FontListString = fontListBox.SelectedItem.ToString();
                DialogResult   = DialogResult.OK;
            }
        }