Hi,
I'm probably being an idiot, but I can't get these to work no matter how correct my code seems to be. I have a window form and I need to run a certain action when the form looses and regains focus. At the moment I have this code (which does squat):
and a similar thing for LostFocus. The *Focus events don't seem to be fired because the Form1_*Focus() methods are not executed. Anybody sees what am I doing wrong? I can post more code if there's a possibility of the events to clash with something else...
Project's target framework is .NET 3.5
I'm probably being an idiot, but I can't get these to work no matter how correct my code seems to be. I have a window form and I need to run a certain action when the form looses and regains focus. At the moment I have this code (which does squat):
<?php
namespace FFBTest
{
public partial class Form1 : Form
{
...
public Form1()
{
InitializeComponent();
this.GotFocus += new EventHandler(Form1_GotFocus);
...
}
...
private void Form1_GotFocus(object sender, EventArgs ea)
{
DInputHandler.DisableAutoCenter();
DInputHandler.ResumeAllEffects();
MessageBox.Show("Got focus!");
}
}
}
?>
Project's target framework is .NET 3.5