Hi,
Can any one plz tell me how to know which form is active in an
application. My app contains many forms and requires to identify the
active form very frequently. I found that there is no property like
Form.ActiveForm available in CompactFramework. I could use a class
which contains a Form class variable to store the current form instance
and assign to it the current form instance in the page_load event of
that form. But this may lead to bugs if i fail to assign the correct
form instance. So i prefer a more direct way. Plz help!

- Hari

Re: How to find the active form in CF by Simon

Simon
Sun Sep 10 04:39:23 CDT 2006

Have you looked at the SNAPI (State Notification API) for Windows Mobile 5
if you are using it. I can't remeber off the top of my head whether the
functionality you require is available in SNAPI.

Alternaively, have you considered creating a base form to which each form
derives which handles this global variable?

Regards
Simon.

"Hari" <hadusumalli@mantragroup.com> wrote in message
news:1157811077.536962.51800@h48g2000cwc.googlegroups.com...
> Hi,
> Can any one plz tell me how to know which form is active in an
> application. My app contains many forms and requires to identify the
> active form very frequently. I found that there is no property like
> Form.ActiveForm available in CompactFramework. I could use a class
> which contains a Form class variable to store the current form instance
> and assign to it the current form instance in the page_load event of
> that form. But this may lead to bugs if i fail to assign the correct
> form instance. So i prefer a more direct way. Plz help!
>
> - Hari
>



Re: How to find the active form in CF by Hari

Hari
Mon Sep 11 02:16:35 CDT 2006

Hi Simon,
Actually i'm not aware of SNAPI. I'm developing the app. using
.Net Compact Framwork and the language as C#. And regarding your second
suggestion, is it not similar to the way i've done. I've used a class
which is meant for holding the instance of the current form and i'm
setting that instance in the page_load event of every form. I think
this is almost similar to deriving from a base form which holds the
form instance as you said. Is it any different. Any other suggestion?
Thanks for the help.

- Hari
Simon Hart wrote:
> Have you looked at the SNAPI (State Notification API) for Windows Mobile 5
> if you are using it. I can't remeber off the top of my head whether the
> functionality you require is available in SNAPI.
>
> Alternaively, have you considered creating a base form to which each form
> derives which handles this global variable?
>
> Regards
> Simon.
>
> "Hari" <hadusumalli@mantragroup.com> wrote in message
> news:1157811077.536962.51800@h48g2000cwc.googlegroups.com...
> > Hi,
> > Can any one plz tell me how to know which form is active in an
> > application. My app contains many forms and requires to identify the
> > active form very frequently. I found that there is no property like
> > Form.ActiveForm available in CompactFramework. I could use a class
> > which contains a Form class variable to store the current form instance
> > and assign to it the current form instance in the page_load event of
> > that form. But this may lead to bugs if i fail to assign the correct
> > form instance. So i prefer a more direct way. Plz help!
> >
> > - Hari
> >


Re: How to find the active form in CF by Peter

Peter
Mon Sep 11 02:58:25 CDT 2006

The managed equivalent of SNAPI is the Microsoft.WindowsMobile.Status
namespace. Take a look at the SystemState.ActiveApplication which may help
although I believe it only stores the names of separate application windows
and not forms within a single application.

Peter

--
Peter Foot
Device Application Development MVP
www.peterfoot.net | www.inthehand.com

"Hari" <hadusumalli@mantragroup.com> wrote in message
news:1157958995.702471.291100@e3g2000cwe.googlegroups.com...
> Hi Simon,
> Actually i'm not aware of SNAPI. I'm developing the app. using
> .Net Compact Framwork and the language as C#. And regarding your second
> suggestion, is it not similar to the way i've done. I've used a class
> which is meant for holding the instance of the current form and i'm
> setting that instance in the page_load event of every form. I think
> this is almost similar to deriving from a base form which holds the
> form instance as you said. Is it any different. Any other suggestion?
> Thanks for the help.
>
> - Hari
> Simon Hart wrote:
>> Have you looked at the SNAPI (State Notification API) for Windows Mobile
>> 5
>> if you are using it. I can't remeber off the top of my head whether the
>> functionality you require is available in SNAPI.
>>
>> Alternaively, have you considered creating a base form to which each form
>> derives which handles this global variable?
>>
>> Regards
>> Simon.
>>
>> "Hari" <hadusumalli@mantragroup.com> wrote in message
>> news:1157811077.536962.51800@h48g2000cwc.googlegroups.com...
>> > Hi,
>> > Can any one plz tell me how to know which form is active in an
>> > application. My app contains many forms and requires to identify the
>> > active form very frequently. I found that there is no property like
>> > Form.ActiveForm available in CompactFramework. I could use a class
>> > which contains a Form class variable to store the current form instance
>> > and assign to it the current form instance in the page_load event of
>> > that form. But this may lead to bugs if i fail to assign the correct
>> > form instance. So i prefer a more direct way. Plz help!
>> >
>> > - Hari
>> >
>



Re: How to find the active form in CF by Simon

Simon
Sat Sep 16 04:54:12 CDT 2006

It is not the same though is it because you are having to remember to set
this variable in each form (page_load delegate).
If you were to derive from a form, this class would handle this variable so
you would not have to remember to set it in each form you create.

Regards
Simon.

"Hari" <hadusumalli@mantragroup.com> wrote in message
news:1157958995.702471.291100@e3g2000cwe.googlegroups.com...
> Hi Simon,
> Actually i'm not aware of SNAPI. I'm developing the app. using
> .Net Compact Framwork and the language as C#. And regarding your second
> suggestion, is it not similar to the way i've done. I've used a class
> which is meant for holding the instance of the current form and i'm
> setting that instance in the page_load event of every form. I think
> this is almost similar to deriving from a base form which holds the
> form instance as you said. Is it any different. Any other suggestion?
> Thanks for the help.
>
> - Hari
> Simon Hart wrote:
>> Have you looked at the SNAPI (State Notification API) for Windows Mobile
>> 5
>> if you are using it. I can't remeber off the top of my head whether the
>> functionality you require is available in SNAPI.
>>
>> Alternaively, have you considered creating a base form to which each form
>> derives which handles this global variable?
>>
>> Regards
>> Simon.
>>
>> "Hari" <hadusumalli@mantragroup.com> wrote in message
>> news:1157811077.536962.51800@h48g2000cwc.googlegroups.com...
>> > Hi,
>> > Can any one plz tell me how to know which form is active in an
>> > application. My app contains many forms and requires to identify the
>> > active form very frequently. I found that there is no property like
>> > Form.ActiveForm available in CompactFramework. I could use a class
>> > which contains a Form class variable to store the current form instance
>> > and assign to it the current form instance in the page_load event of
>> > that form. But this may lead to bugs if i fail to assign the correct
>> > form instance. So i prefer a more direct way. Plz help!
>> >
>> > - Hari
>> >
>