PC Review


Reply
Thread Tools Rate Thread

How to activate main form

 
 
Janez
Guest
Posts: n/a
 
      30th Dec 2004
Hi,

I have the following problem with CF application:
1. I start application with two forms from File explorer, form1 is
displayed initially.
2. I open form2 modally from form1, so form2 is on top of the form1.
3. Now I go back to File explorer through Start menu. My application
is now hidden, but still running.
4. I tap on my application in file explorer so the application is
brought back to front again, modal form2 is active form.
5. Now I close modal form2 and there is the problem; I want form1 to
be activated, but File explorer becomes active, so I need to minimize
File explorer to activate Form1.

Any solution to this?

I am using Pocket PC 2002 and CF 1.0 SP2.

Regards
Janez
 
Reply With Quote
 
 
 
 
Dan Bass
Guest
Posts: n/a
 
      30th Dec 2004
You could bring the focus to form1 right after form2.ShowModal() is
called... This way once the thread that has created ShowModal returns, the
next thing it does it to activate and bring your caller to the front.

HTH

Dan.



"Janez" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I have the following problem with CF application:
> 1. I start application with two forms from File explorer, form1 is
> displayed initially.
> 2. I open form2 modally from form1, so form2 is on top of the form1.
> 3. Now I go back to File explorer through Start menu. My application
> is now hidden, but still running.
> 4. I tap on my application in file explorer so the application is
> brought back to front again, modal form2 is active form.
> 5. Now I close modal form2 and there is the problem; I want form1 to
> be activated, but File explorer becomes active, so I need to minimize
> File explorer to activate Form1.
>
> Any solution to this?
>
> I am using Pocket PC 2002 and CF 1.0 SP2.
>
> Regards
> Janez



 
Reply With Quote
 
Daniel Moth
Guest
Posts: n/a
 
      30th Dec 2004
If BringToFront doesn't work try SetForegroundWindow (Peter Foot's blog
entry):
http://blog.opennetcf.org/pfoot/Perm...d-0950e9d16b10

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


"Janez" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I have the following problem with CF application:
> 1. I start application with two forms from File explorer, form1 is
> displayed initially.
> 2. I open form2 modally from form1, so form2 is on top of the form1.
> 3. Now I go back to File explorer through Start menu. My application
> is now hidden, but still running.
> 4. I tap on my application in file explorer so the application is
> brought back to front again, modal form2 is active form.
> 5. Now I close modal form2 and there is the problem; I want form1 to
> be activated, but File explorer becomes active, so I need to minimize
> File explorer to activate Form1.
>
> Any solution to this?
>
> I am using Pocket PC 2002 and CF 1.0 SP2.
>
> Regards
> Janez



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Requery main form after subform update and not lose place in main form. Michael Microsoft Access Form Coding 1 23rd Nov 2010 09:26 PM
I want a main form to activate when I open the database Fernandello Microsoft Access Forms 2 24th Nov 2008 09:53 PM
Link Subforms to Main Form - 2 Linked Combo Boxes in Main Form =?Utf-8?B?Sm9obiBE?= Microsoft Access Form Coding 3 4th Feb 2007 02:08 AM
Activate Main Form Bill Byrnes Microsoft Dot NET Framework Forms 1 14th Jan 2006 05:29 PM
=> Open Subform on Main Form initiated by button on Main Form Rhonda Fischer Microsoft Access Form Coding 1 8th Dec 2003 05:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:37 PM.