how can i make my combobox to show it's max index at all times?
You mean the last item in it?
In that case it would be combobox.SelectedItemIndex = combobox.Items.Count - 1;
This is just a guess though, since I don't have time to try it out for now. Give it a go and tell me if it is what you seek.
If you are talking about the dropdown height, there is a property for that setting.
it is not working.
the options are selecteditem
or selected index.
from some reason it is not working.
if i have 10 numbers in my combobox
after i pick 3 i have a function which updates the combobox numbers to be from 1 to 7. and i want 7 to appear on the combobox window.
I have no idea why anyone would ever want to do this, but here you go...
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
comboBox1.SelectedIndexChanged -= comboBox1_SelectedIndexChanged;
int i = Convert.ToInt32(comboBox1.SelectedItem.ToString());
int j = Convert.ToInt32(comboBox1.Items[comboBox1.Items.Count - 1]) -i;
for (int z = 1; z <= j ; z++)
if(comboBox1.Items.Count > 0)
comboBox1.Text = comboBox1.Items[comboBox1.Items.Count - 1].ToString();
comboBox1.SelectedIndexChanged += comboBox1_SelectedIndexChanged;
That does seem like a weird course of action to take. Well...Good job I guess Jerry :p
ok i got what i needed
Who can help me with the following
For Each Con As Control In GroupBox1.Controls
If Con.GetType Is GetType(Button) Then
Con.BackColor = SystemColors.Control
Con.UseVisualStyleBackColor = True
Can someone ...
So before I went and posted ~800 lines of code, I have 2 questions:
1: What is the preferred way for us to post "complex" C++ (of course, ...
private void EnterAcNotextBox_TextChanged(object sender, EventArgs e)
if (!int.TryParse(AcNotextBox.Text, out id))
string connString = ConfigurationManager.ConnectionStrings["dbx"].ConnectionString;
string cmdString = "SELECT '#' FROM tblBasicInfo, tblAccData WHERE ID ...