PC Review


Reply
Thread Tools Rate Thread

Application in focus

 
 
Alan T
Guest
Posts: n/a
 
      5th Sep 2006
How do I make my application back to focus during it is processing I switch
to other application and back ?

During my application processing, I open another application, eg. notepad.
Then I select my application, my application screen is in white.


 
Reply With Quote
 
 
 
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      5th Sep 2006
This isn't a focus issue, this is a matter of you doing all the
processing on the main UI thread.

Perform your processing on another thread, and leave the UI thread to
process messages, and you should have no problem switching back.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (E-Mail Removed)

"Alan T" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> How do I make my application back to focus during it is processing I
> switch to other application and back ?
>
> During my application processing, I open another application, eg. notepad.
> Then I select my application, my application screen is in white.
>



 
Reply With Quote
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      5th Sep 2006
Alan,

You have in my idea more possibilities to that as
the method
http://msdn2.microsoft.com/en-us/lib...rol.focus.aspx

or the properties
TopLevel and TopMost be aware that those can be annoying so when you use
them you can set them to true and direct than to false.

I hope this helps,

Cor


"Alan T" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> How do I make my application back to focus during it is processing I
> switch to other application and back ?
>
> During my application processing, I open another application, eg. notepad.
> Then I select my application, my application screen is in white.
>



 
Reply With Quote
 
Alan T
Guest
Posts: n/a
 
      6th Sep 2006
What I want to do is I want to let the process finish first before the user
can select the main form.
During the process the cursor is in "wait" type.
I just want to make the main form appear normal except cannot select the
controls on the form.If the main form appears in white, the user may think
the system is hang.

"Nicholas Paldino [.NET/C# MVP]" <(E-Mail Removed)> wrote in
message news:%(E-Mail Removed)...
> This isn't a focus issue, this is a matter of you doing all the
> processing on the main UI thread.
>
> Perform your processing on another thread, and leave the UI thread to
> process messages, and you should have no problem switching back.
>
> Hope this helps.
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - (E-Mail Removed)
>
> "Alan T" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> How do I make my application back to focus during it is processing I
>> switch to other application and back ?
>>
>> During my application processing, I open another application, eg.
>> notepad. Then I select my application, my application screen is in white.
>>

>
>



 
Reply With Quote
 
Alan T
Guest
Posts: n/a
 
      11th Oct 2006
Hi,

This is what I did to solve my problem:

Main Form:
private void tsMnRebuild_Click(object sender, EventArgs e)

{

Thread KeywordThread = new Thread(new ThreadStart(this.ExecuteRebuild));

KeywordThread.Start();

}

private void ExecuteRebuild()

{

.........

.........

}



I have a conern:

Is there any possibility to make the main form crash if something happen to
the thread ?



"Cor Ligthert [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Alan,
>
> You have in my idea more possibilities to that as
> the method
> http://msdn2.microsoft.com/en-us/lib...rol.focus.aspx
>
> or the properties
> TopLevel and TopMost be aware that those can be annoying so when you use
> them you can set them to true and direct than to false.
>
> I hope this helps,
>
> Cor
>
>
> "Alan T" <(E-Mail Removed)> schreef in bericht
> news:(E-Mail Removed)...
>> How do I make my application back to focus during it is processing I
>> switch to other application and back ?
>>
>> During my application processing, I open another application, eg.
>> notepad. Then I select my application, my application screen is in white.
>>

>
>



 
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
Application Focus NvrBst Microsoft C# .NET 5 21st Jan 2008 09:44 PM
Application Focus Miro Microsoft VB .NET 2 30th Jul 2007 08:16 PM
Application.Idle not called when application does not have focus dcolak@gmail.com Microsoft Dot NET Framework Forms 1 1st Nov 2006 06:00 PM
Application focus Chris Microsoft Dot NET Compact Framework 2 21st Jul 2005 01:46 AM
re focus on application Taluron Microsoft VB .NET 0 5th Mar 2005 01:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:33 PM.