CadEditor.UtilsGui.setCbItemsCount C# (CSharp) Метод

setCbItemsCount() публичный статический Метод

public static setCbItemsCount ( ComboBox cb, int count, int first, bool inHex = false ) : void
cb System.Windows.Forms.ComboBox
count int
first int
inHex bool
Результат void
        public static void setCbItemsCount(ComboBox cb, int count, int first = 0, bool inHex = false)
        {
            cb.Items.Clear();
            if (!inHex)
            {
                for (int i = 0; i < count; i++)
                    cb.Items.Add(first + i);
            }
            else
            {
                for (int i = 0; i < count; i++)
                    cb.Items.Add(String.Format("{0:X}", first + i));
            }
        }

Usage Example

Пример #1
0
 private void FormStructuresName_Load(object sender, EventArgs e)
 {
     UtilsGui.setCbItemsCount(cbWidth, 64, 1);
     UtilsGui.setCbItemsCount(cbHeight, 64, 1);
     cbWidth.SelectedIndex  = StructWidth - 1;
     cbHeight.SelectedIndex = StructHeight - 1;
     cbName.Text            = StructName;
     Result = false;
 }
All Usage Examples Of CadEditor.UtilsGui::setCbItemsCount