コード例 #1
0
 public FormFontChooser()
 {
     InitializeComponent();
     fntDlgDir = new FontDialogDirector(this);
     foreach (var fontFam in FontFamily.Families)
     {
         lstBxFonts.Items.Add(fontFam.Name);
         txtbxFamily.AutoCompleteCustomSource.Add(fontFam.Name);
     }
 }
コード例 #2
0
        static void Main(string[] args)
        {
            DialogDirector fontMediator = new FontDialogDirector();

            ListBox       myListBox = new ListBox(fontMediator);
            List <string> data      = new List <string> {
                "Arial", "Comic Sans", "Athletic", "Airborne"
            };

            myListBox.SetList(data);

            Entry myEntry = new Entry(fontMediator);

            fontMediator.AddWidget(myListBox);
            fontMediator.AddWidget(myEntry);

            myListBox.Choose(2);
            myEntry.Enter("ic");
        }