I present the user a NumericUpDown control so he can specify the size of a texture. It is important that this texture is of power of two size (32, 64, 128...).
I hav
My suggestion is to use a ComboBox
, you will have your numbers dropped down, you support auto complete and at the same time escape the validation of user input, code like:
//generate your array.
List twos = new List();
int item = 2;
int max = int.MaxValue / 2;
while ((item = 2 * item) < max)
{
twos.Add(item.ToString());
}
ComboBox comboBox1 = new ComboBox();
comboBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
comboBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
comboBox1.FormattingEnabled = true;
//comboBox1.Items.Clear();
comboBox1.Items.AddRange(twos.ToArray());
comboBox1.AutoCompleteCustomSource.AddRange(twos.ToArray());
this.Controls.Add(comboBox1);