wireztap.com
aisniff.com
botprowl.com
botsnoop.com
aiwiretap.com
He was very tired,
He worked at the s
When he stood up a
botingtonpost.com
This game is just

This beautiful aud
Each time you will
bothose.com
botpoke.com
men got closer to
even though most o
It means you can b
Girl Power
Top 10 illegal ite
You Call, We'll Ha
I have been asked to create a form to process payroll information into a database. The end users want to be able to select 'one or more of' every employee in the company. At this point I have a multi-select list box which is populated with all employee names in the database. The users must select either 'All' or at least one employee. If the user selects 'All' or does not make a selection, the system must then default to the 'All' option. Is there a simple way to determine that the 'All' option was selected? A: The way you're trying to do it won't work. One solution to your problem would be to provide a default all check box item and a blank item. For any other item in the list you'd have to uncheck the all check box and the blank item. The all check box wouldn't be used. Hope this helps. A: I suggest a different approach: Add a new field to your table named "all" Add a check box in your form and then use this code to fill your all fields private void listbox1_SelectedIndexChanged(object sender, EventArgs e) { lbl1.Text = listBox1.SelectedValue.ToString(); } private void lbl1_TextChanged(object sender, EventArgs e) { if (listBox1.SelectedValue != "" && lbl1.Text == listBox1.SelectedValue) listBox1.Text = ""; } I have this done to create a multiselect listbox, when I press an "add" button. I add an item with the value "all". A: An other way to do it is to handle listbox SelectedIndexChanged event as: private void listBox_SelectedIndexChanged(object sender, EventArgs e) { string all = "ALL"; if (listBox.SelectedValue == all) { txt.Text = ""; } else { txt.Text = listBox.SelectedValue.ToString(); } } Edit For this to work you must include 'ALL' in your list. Edit (2) You need to set InitialDirectory and InitialFile to the values of the .cs file. Then, you can use the current code below. private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { int index = listBox1.SelectedIndex; string selected_text = listBox1.GetItemText(index); string all = "ALL"; if (listBox.SelectedValue == all) { label1.Text = "ALL"; } else { label1.Text = listBox.SelectedValue.ToString(); } } If you have more than 1 value in your list, then you can use: if(listBox1.SelectedValue == "ALL") { label1.Text = ""; } If you want ALL value, then uncheck the listbox box. Otherwise, when you click a value, it will write the value. Edit (3) As per your example, there is another way to do it. Check this out: private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { ListBox my_list = listBox1; string selected_text = ""; int my_index = listBox1.SelectedIndex; if (my_index >= 0) { selected_text = my_list.GetItemText(my_index); } else { selected_text = listBox1.SelectedItem.ToString(); } label1.Text = selected_text; } I have tested it, and it works great. Edit (4) You must have ListBox2 (that I will name lstBox) and you need to define this method: private void listBox2_SelectedIndexChanged(object sender, EventArgs e) { int index = listBox2.SelectedIndex; string selected_text = listBox2.GetItemText(index); string all = "ALL"; if (listBox2.SelectedValue == all) { lstBox.SelectedItem = ""; } else { lstBox.SelectedItem = listBox2.SelectedValue.ToString(); } //lstBox.SelectedItem = listBox2.SelectedValue.ToString(); //this line will clear TextBox1 and set value to 0 int.TryParse(textBox1.Text, out integer1); textBox1.Text = "0"; } I have tested it, and it works great.