Mysterious Input Panel Behavior

R

Rick

I've added an input panel to a blank form. There is no code involved
in the form. If I open up another application, such as Contacts and
show the input panel. Then switch back to my form, the input panel is
shown there too. I need to be make sure input panel doesn't show on
my form when it's shown on another application. To further
illustrate, see the following URL for a 30 second recording of what
I'm seeing. Please note that showing or hiding the SIP on my form
does not affect the status of the SIP the other application.
http://www.agiletechnicalsolutions.com/sip.wmv

The below code is the code behind for the form. You'll see that there
is nothing there.

The question is, how do I scope the SIP behavior to my app, not
allowing other apps to change the SIP status on MY app?

public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();

}

private bool SipEnabled = false;


private void Form1_Activated(object sender, EventArgs e)
{

}

private void Form1_GotFocus(object sender, EventArgs e)
{

}

private void Form1_Paint(object sender, PaintEventArgs e)
{

}

private void inputPanel1_EnabledChanged(object sender, EventArgs e)
{

}

private void Form1_Deactivate(object sender, EventArgs e)
{

}

private void Form1_LostFocus(object sender, EventArgs e)
{

}

private void Form1_EnabledChanged(object sender, EventArgs e)
{

}

private void Form1_Closing(object sender, CancelEventArgs e)
{

}

private void Form1_Closed(object sender, EventArgs e)
{

}

private void Form1_Load(object sender, EventArgs e)
{

}
}
 
G

Guest

There's nothing mysterious about it - that is normal, expected behavior.
The SIP is not part of your application, it's part of the shell. There is
one and only one SIP, so if it's shown, it's shown. If it's hidden, it's
hidden. The App that is running has no bearing on it. If you bring the SIP
up in your app and want it to stay there when the user returns then show the
SIP in the OnActivate event for your Form.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
 
R

Rick

If you notice in my movie, the SIP in Contacts operates independently
from other applications. I tried saving the status of the SIP when
switching to another application, but the InputPanel.EnabledChanged
event fires BEFORE Form.EnabledChanged, Form.LostFocus,
Form.Deactivate. How would one go about saving the SIP state when
switching to another app?

See this code:

private bool SipEnabled = false;


private void Form1_Activated(object sender, EventArgs e)
{
inputPanel1.Enabled = SipEnabled;
}

private void Form1_Deactivate(object sender, EventArgs e)
{
SipEnabled = inputPanel1.Enabled;
}

private void inputPanel1_EnabledChanged(object sender, EventArgs e)
{
// If the Status of the sip on the other app is different from the
current one,
// it fires this event BEFORE Deactivate, causing SipEnabled to always
be the state of the
// SIP in the other APP
}
 
G

Guest

You need to simply set it when your Form loses focus and reset it when it's
activated. It's not about the events fromt he SIP - they aren't relevent
for what you want - you just need to ask what state it's in when you change
form state/focus.

-Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top