Click here to Skip to main content
16,005,697 members
Home / Discussions / C#
   

C#

 
GeneralRe: Exception not thrown when it should be Pin
tachobg14-Aug-06 11:19
tachobg14-Aug-06 11:19 
GeneralRe: Exception not thrown when it should be Pin
Ennis Ray Lynch, Jr.14-Aug-06 11:56
Ennis Ray Lynch, Jr.14-Aug-06 11:56 
GeneralRe: Exception not thrown when it should be Pin
tachobg15-Aug-06 3:28
tachobg15-Aug-06 3:28 
GeneralRe: Exception not thrown when it should be Pin
tachobg15-Aug-06 3:36
tachobg15-Aug-06 3:36 
QuestionOpen a MainMenu menu [modified] Pin
myNameIsRon14-Aug-06 8:13
myNameIsRon14-Aug-06 8:13 
QuestionHow to refresh background application when a process is running? [modified] Pin
yan8814-Aug-06 8:08
yan8814-Aug-06 8:08 
AnswerRe: How to refresh background application when a process is running? Pin
Mike Dimmick14-Aug-06 16:39
Mike Dimmick14-Aug-06 16:39 
GeneralRe: How to refresh background application when a process is running? Pin
yan8815-Aug-06 7:35
yan8815-Aug-06 7:35 
Hi Mike,

Thanks for your reply. I'm still not sure where to use Control.Invoke. Here is my code:

<br />
private void mainFrameButton_Click(object sender, EventArgs e)<br />
{<br />
ThreadStart worker = new ThreadStart(WorkerThreadMethod);<br />
Thread t = new Thread(worker);<br />
t.Start();<br />
<br />
this.Invoke(worker);<br />
this.Enabled = false;<br />
}<br />
<br />
public void WorkerThreadMethod()<br />
{            <br />
this.process1.StartInfo.FileName = ExeFile;<br />
this.process1.StartInfo.Arguments = ArgFile;<br />
this.process1.Start();<br />
this.process1.WaitForExit();<br />
}<br />
<br />
private void process1_Exited(object sender, EventArgs e)<br />
{<br />
this.Enabled = true;<br />
}<br />


It didn't work, and the worse thing is the third-party program poped up twice, and even it's closed, the main application UI was still disabled.

Some help please? Thanks.
Questionlist view Pin
TAREQ F ABUZUHRI14-Aug-06 7:26
TAREQ F ABUZUHRI14-Aug-06 7:26 
QuestionEnum within a button click event on a form - why compile error [modified] Pin
LuluSailor14-Aug-06 6:42
LuluSailor14-Aug-06 6:42 
AnswerRe: Enum within a button click event on a form - why compile error Pin
Andrew Rissing14-Aug-06 7:00
Andrew Rissing14-Aug-06 7:00 
GeneralRe: Enum within a button click event on a form - why compile error Pin
LuluSailor14-Aug-06 7:11
LuluSailor14-Aug-06 7:11 
GeneralRe: Enum within a button click event on a form - why compile error Pin
Rob Graham14-Aug-06 7:50
Rob Graham14-Aug-06 7:50 
GeneralRe: Enum within a button click event on a form - why compile error Pin
LuluSailor14-Aug-06 9:16
LuluSailor14-Aug-06 9:16 
GeneralRe: Enum within a button click event on a form - why compile error Pin
Dave Kreskowiak14-Aug-06 10:36
mveDave Kreskowiak14-Aug-06 10:36 
GeneralRe: Enum within a button click event on a form - why compile error Pin
LuluSailor14-Aug-06 11:42
LuluSailor14-Aug-06 11:42 
Questionsystem properties Pin
Harikrk14-Aug-06 6:40
Harikrk14-Aug-06 6:40 
AnswerRe: system properties Pin
Rob Graham14-Aug-06 7:59
Rob Graham14-Aug-06 7:59 
Questioncreating OCX Pin
Harikrk14-Aug-06 5:27
Harikrk14-Aug-06 5:27 
AnswerRe: creating OCX Pin
Rob Graham14-Aug-06 5:42
Rob Graham14-Aug-06 5:42 
GeneralRe: creating OCX Pin
Harikrk14-Aug-06 5:55
Harikrk14-Aug-06 5:55 
GeneralRe: creating OCX Pin
Rob Graham14-Aug-06 6:17
Rob Graham14-Aug-06 6:17 
GeneralRe: creating OCX Pin
Harikrk14-Aug-06 6:22
Harikrk14-Aug-06 6:22 
GeneralRe: creating OCX Pin
Rob Graham14-Aug-06 7:32
Rob Graham14-Aug-06 7:32 
GeneralRe: creating OCX Pin
Judah Gabriel Himango14-Aug-06 6:22
sponsorJudah Gabriel Himango14-Aug-06 6:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.