Enable one Active window at a time

  • Thread starter Thread starter arora.dipti
  • Start date Start date
A

arora.dipti

Hi
We are working on a Health Contact Center Application in which a
patient is able to contact using either Chat Application or Phone Call
with the Doctors.
When the doctor is contacted using either of these means, a popup
appears at the Doctor's End and he is able to communicate with the
patient. When a doctor is busy handling the Phone Call ( a windows
form), he should not be able to work with the Chat Request(less
Priority) but when he is working with the Chat Application,he can work
on the phone Call(high Priority).
So we want to have some mechanism in which if these two popups(Phone
and Chat Window) are open at the sametime,doctor should be able to
work on Phone Call only and Focus Should not Go to Chat Window.

Please help
 
hello,
You can either use a JavaScript or c# to do this
JavaScript
if (!phonewindow.closed && phonewindow.location) ----> this will check if
the window is open and still in use
{
chatwindow.blur() -----------> chat window will loose focus
}


C# ----->

You can use C# by using window.enable property as "pseudo code" below
shows ---

if(phonewindow.active) ---. shows if a window is active
{
chatwindow.enable = false; //disables chat window so user can't use it
}

I hope this helps
regards
l33t
 
Hi
We are working on a Health Contact Center Application in which a
patient is able to contact using either Chat Application or Phone Call
with the Doctors.
When the doctor is contacted using either of these means, a popup
appears at the Doctor's End and he is able to communicate with the
patient. When a doctor is busy handling the Phone Call ( a windows
form), he should not be able to work with the Chat Request(less
Priority) but when he is working with the Chat Application,he can work
on the phone Call(high Priority).
So we want to have some mechanism in which if these two popups(Phone
and Chat Window) are open at the sametime,doctor should be able to
work on Phone Call only and Focus Should not Go to Chat Window.

Please help

(Accidentally emailed first time round!)

I presume this is a winforms application and not an ASP.NET app?

You could do it the simple way or the hard way! The simple way might not be
fully to your needs though.

Simple way: Just open the Phone form using .ShowDialog() and open the chat
form using .Show().

Hard way: If you only want to restrict viewing the phone form when the chat
form is open then you will need to hook into the chat form's GotFocus event,
and then scan to see if the user has an instance of the phone form open. If
they do, send the focus to the phone form (thereby disallowing them to
change the focus to the chat form).
 
Back
Top