Hi flatarheel,
You said The problem is that no other controls on the form work. Could you please tell me what issues you met on other controls?
You also said I think my listbox is cuasing a focus/unfocus problem but i'm not sure.
You can handle GotFocus or LostFocus events and show some messages to trace the focus changing in the form. This is a code snippet:
private void Form1_Load(object sender, EventArgs e)
{
foreach (Control ctrl in this.Controls)
{
ctrl.GotFocus += new EventHandler(ctrl_GotFocus);
ctrl.LostFocus += new EventHandler(ctrl_LostFocus);
}
}
void ctrl_GotFocus(object sender, EventArgs e)
{
Console.WriteLine((sender as Control).Name + "got focus.");
}
void ctrl_LostFocus(object sender, EventArgs e)
{
Console.WriteLine((sender as Control).Name + "lost focus.");
}
It is appreciated if you could provide a code snippet or provide more information about the issue.
Let me know if this helps.
Aland Li
Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.