Forum Discussion
Jul 25, 2006
In the video, I used a CheckedListBox which has the following Add() method:
Add(object item);
Add(object item, CheckState check);
Add(object item, bool isChecked);
The ListBox class only has one Add method
Add(object item)
Odds are that you are using a standard listbox.
Also, you have the parameters reversed in your code. The checked state is the second parameter, not the first.
private System.Windows.Forms.CheckedListBox lb_nodes;
.
.
.
//------------------------------------------------------------------------
// Loop over the items
//------------------------------------------------------------------------
for(int i=0; i{
lb_nodes.Items.Add(
node_defs[ i ].address + ":" +node_defs[ i ].port.ToString(),
Convert.ToBoolean(state[ i ]));
}
Try switching your control to a CheckedListBox, switch the parameters and you should be set.
-Joe