R
richB
How do I deslect all items in a listbox?
I know that the ClearSelected method will deselect the items however in
the displayed list box the first item appears to be selected. Can anyone
explain why this is and provide a solution.
Many Thanks, Richard
My code is as follows (prior to the ClearSelected method the selected
Index is 0 and after it is -1).
this.associatedPrinters.DataSource =
FillDropDown.GetFillDropDown("AssociatedPrinterList",ink.Inkid);
this.associatedPrinters.DisplayMember = "PrinterDescription";
this.associatedPrinters.ValueMember = "PrinterId";
Console.WriteLine (this.associatedPrinters.SelectedIndex.ToString());
this.associatedPrinters.ClearSelected();
Console.WriteLine(this.associatedPrinters.SelectedIndex.ToString());
I know that the ClearSelected method will deselect the items however in
the displayed list box the first item appears to be selected. Can anyone
explain why this is and provide a solution.
Many Thanks, Richard
My code is as follows (prior to the ClearSelected method the selected
Index is 0 and after it is -1).
this.associatedPrinters.DataSource =
FillDropDown.GetFillDropDown("AssociatedPrinterList",ink.Inkid);
this.associatedPrinters.DisplayMember = "PrinterDescription";
this.associatedPrinters.ValueMember = "PrinterId";
Console.WriteLine (this.associatedPrinters.SelectedIndex.ToString());
this.associatedPrinters.ClearSelected();
Console.WriteLine(this.associatedPrinters.SelectedIndex.ToString());