01/10/2018, 15:21

Sử dụng Ribboncombobox

Chào mọi người!
Em sử dụng vòng lặp for để thêm các đối tượng vào trong ribbon Combobox khi load form lên. Nhưng khi build xong thì click vô combobox đó để sổ Items xuống thì ko thấy nó xổ cái gì ra hết ạ, mong mọi người giúp đỡ
code của em đây:

for (int i = 10; i < 70; i++)
            {
                RibbonButton rbtn = new RibbonButton();
                rbtn.Text = i.ToString();
                ribbonComboBox2.DropDownItems.Add(rbtn);
            }
            //ribbonComboBox2.SelectedItem = ribbonComboBox2.DropDownItems[0];
            //-----------Tạo danh sách font chữ
            System.Drawing.Text.InstalledFontCollection fonts = new System.Drawing.Text.InstalledFontCollection();
            foreach (FontFamily family in fonts.Families)
            {
                RibbonButton rbtn = new RibbonButton();
                rbtn.Text = family.Name.ToString();
                ribbonComboBox1.DropDownItems.Add(rbtn);
            }
Bài liên quan
0