Hi,
is it possible to make losing focus programatically on a window?
like this:
window1.GotFocus += new routedeventhandler(window1_GotFocus);
window2.GotFocus += new ...( window2_GotFocus);
void window1_GotFocus(...)
{
// lose window2 focus
}
void window2_GotFocus(...)
{
// lose window1 focus
}
Because right now, I have 2 Radwindow, but when I have focus on one and when I click on the other I don't lose the focus of the first RadWindow. How I know that? Because I have this code:
window1.GotFocus += new routedeventhandler(window1_GotFocus);
window1.LostFocus += new routedeventhandler(window1_LostFocus);
window2.GotFocus += new routedeventhandler( window2_GotFocus);
window2.LostFocus += new routedeventhandler(window2_LostFocus);
void window1_GotFocus(object sender, routedeventargs e)
{
var window = sender as RadWindow;
if (window != null && window.IsActiveWindow)
{
mytextblos.Text += "\ngot focus fenetre 1";
}
}
void window1_LostFocus(object sender, routedeventargs e)
{
var window = sender as RadWindow;
if (window != null && !window.IsActiveWindow)
{
mytextblos.Text += "\nLostfocus fenetre 1";
}
}
void window2_GotFocus(object sender, routedeventargs e)
{
var window = sender as RadWindow;
if (window != null && window.IsActiveWindow)
{
mytextblos.Text += "\ngot focus fenetre 2";
}
}
void window2_LostFocus(object sender, routedeventargs e)
{
var window = sender as RadWindow;
if (window != null && !window.IsActiveWindow)
{
mytextblos.Text += "\nLostfocus fenetre 2";
}
}
but sometimes the "lostfocus fenetre i" doesn't work.....
Please help !
Erawan
is it possible to make losing focus programatically on a window?
like this:
window1.GotFocus += new routedeventhandler(window1_GotFocus);
window2.GotFocus += new ...( window2_GotFocus);
void window1_GotFocus(...)
{
// lose window2 focus
}
void window2_GotFocus(...)
{
// lose window1 focus
}
Because right now, I have 2 Radwindow, but when I have focus on one and when I click on the other I don't lose the focus of the first RadWindow. How I know that? Because I have this code:
window1.GotFocus += new routedeventhandler(window1_GotFocus);
window1.LostFocus += new routedeventhandler(window1_LostFocus);
window2.GotFocus += new routedeventhandler( window2_GotFocus);
window2.LostFocus += new routedeventhandler(window2_LostFocus);
void window1_GotFocus(object sender, routedeventargs e)
{
var window = sender as RadWindow;
if (window != null && window.IsActiveWindow)
{
mytextblos.Text += "\ngot focus fenetre 1";
}
}
void window1_LostFocus(object sender, routedeventargs e)
{
var window = sender as RadWindow;
if (window != null && !window.IsActiveWindow)
{
mytextblos.Text += "\nLostfocus fenetre 1";
}
}
void window2_GotFocus(object sender, routedeventargs e)
{
var window = sender as RadWindow;
if (window != null && window.IsActiveWindow)
{
mytextblos.Text += "\ngot focus fenetre 2";
}
}
void window2_LostFocus(object sender, routedeventargs e)
{
var window = sender as RadWindow;
if (window != null && !window.IsActiveWindow)
{
mytextblos.Text += "\nLostfocus fenetre 2";
}
}
but sometimes the "lostfocus fenetre i" doesn't work.....
Please help !
Erawan