CheckedListBox question

Is there a way to change the color of highlight ? selection?

it's blue by default....

[102 byte] By [GoDaddy] at [2007-12-24]
# 1
I don't think so, this is controlled by a system color. You'd change it by right-clicking the desktop, Properties, Appearance, Advanced, Selected items property.
nobugz at 2007-10-8 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 2

I would like to completely turn off this highlight. Is there a way to do this? I just want the checkboxes to be checked/unchecked. There is no need for the entire item to be selected when checking/unchecking.

I also tried using checkboxes inside of a groupbox and accessing them with foreach (CheckBox checkbox in groupBox1.Controls), but the values are returned in "bottom to top" order.

The_Kirk at 2007-10-8 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 3

ok this is what I did.....

privatevoid button3_Click(object sender, EventArgs e)

{

for (int i = groupBox1.Controls.Count-1; i >= 0; i--)

{

CheckBox chx = (CheckBox)groupBox1.ControlsIdea;

if (chx.Checked)

{

MessageBox.Show(chx.Name);

}

}

}

The_Kirk at 2007-10-8 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 4
Set the SelectionMode property to None and add this MouseDown event handler:

private void myCheckedListBox1_MouseDown(object sender, MouseEventArgs e) {
int ix = CheckedListBox1.IndexFromPoint(e.Location);
if (ix >= 0) CheckedListBox1.SetItemChecked(ix, !CheckedListBox1.GetItemChecked(ix));
}

nobugz at 2007-10-8 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 5
perfect! Thanks so much.
The_Kirk at 2007-10-8 > top of Msdn Tech,Windows Forms,Windows Forms General...