當每一次打開或者關閉SIP時,在SIPEnabledChanged函數(shù)中就會調用這段代碼。該函數(shù)的實現(xiàn)代碼如程序清單4-23所示。
程序清單4-23 對SIP的EnabledChanged事件進行響應
/// <summary>
/// Respond to the SIP opening or closing
/// </summary>
private void SIPEnabledChanged(object sender, EventArgs e)
{
// Has the input panel enabled state changed to false?
if (_inputPanel != null && _inputPanel.Enabled == false)
{
// The SIP has closed so force a repaint of the whole window.
// Otherwise the SIP imagery is left behind on the screen.
ForceRepaint();
}
}