how to find sip on parent form?

  • Thread starter Thread starter 1001001001
  • Start date Start date
1

1001001001

Hi i have this code but it doesnt seem to work. "SIP found" is never displayed.

//find sip on parent
if(sip == null)
{
MessageBox.Show("looking for sip");
foreach (Object c in this.Parent.Controls) //this = a panel on the parent form
{
if(c is Microsoft.WindowsCE.Forms.InputPanel)
{
MessageBox.Show("SIP Found");
sip = c as InputPanel;
}
}
}

is the sip not contained in the form controls collection? where is it?
 
InputPanel derives from Component (not control).

Regardless, look at the code in your form's InitializeComponent; controls such as button, label etc are added to the form's Controls collection but the reference to the InputPanel isn't. Refer to it directly e.g. via inputPanel1

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


Hi i have this code but it doesnt seem to work. "SIP found" is never displayed.

//find sip on parent
if(sip == null)
{
MessageBox.Show("looking for sip");
foreach (Object c in this.Parent.Controls) //this = a panel on the parent form
{
if(c is Microsoft.WindowsCE.Forms.InputPanel)
{
MessageBox.Show("SIP Found");
sip = c as InputPanel;
}
}
}

is the sip not contained in the form controls collection? where is it?
 
Back
Top