Ask Experts Questions for FREE Help !
Ask
    Swati_Aggarwal's Avatar
    Swati_Aggarwal Posts: 2, Reputation: 1
    New Member
     
    #1

    Nov 2, 2009, 04:34 AM
    To bind the message box to application main thread
    Hi... I have windows application (Asp.net , C#). While performing an activity I display a message box and I want that user should not be able to bypass the messagebox. Until and unless he clicks (YES or NO) he should not be able to perform any operation in application. The problem is that rights I am on a diiferent thread than the main application. So how to attach this new message box to the main application ?
    Perito's Avatar
    Perito Posts: 3,139, Reputation: 150
    Ultra Member
     
    #2

    Nov 5, 2009, 01:49 PM

    See if this doesn't help:

    Tools for Updating Windows Forms UI from Background Threads

    Generally, you use a subroutine in the main thread and use Invoke, as shown in the link, to activate it. Put the data to be placed in the main thread in a convenient variable. If there's ever the risk that the variable will be read before it's fully written, you must protect it with a mutex or something similar.
    Swati_Aggarwal's Avatar
    Swati_Aggarwal Posts: 2, Reputation: 1
    New Member
     
    #3

    Nov 5, 2009, 10:04 PM
    Thanks for the reply Perito... It would help.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Exception in main thread: java.lang.NoClassDefFoundError. [ 3 Answers ]

Hi, Java program is compiling successfully.while running I am getting the error as Exception in main thread java.lang.NoClassDefFoundError.how to solve this?I have set classpath as c:program files/java/jdk1.5.0_05/jre/tools.jar... Please reply asap..

How do I fix "could not find main class" error message. [ 1 Answers ]

When I install oracle application,I got this error message, then I install JVM,it only upgraded previous version on my system.I reinstalled and all I could get is the same error message. How do I fix it?

Can't install SKYPE 4.0 > Message:.\SkypeSetup.exe is not a valid Win32 application [ 1 Answers ]

On attempting to run SkypeSetup.exe after downloading Skype 4.0 into my laptop using Windows Vista I am receiving this message, "C:\Users\ <my name>\My Programs\SKYPE 4.0\SkypeSetup.exe is not a valid Win32 application". However, I was able to run SkypeSetup.exe after downloading Skype 4.0...

In a Bind. [ 14 Answers ]

I think I have put myself in the worst situation I have ever come across... I have a newly discovered best friend, we have always been good friends but out friendship moved to a new level, we discovered we have more in common than two people could even hope to share, we also discovered that a...

A Repeating Application Error Message. [ 2 Answers ]

FONT-Courier NewSIZE=3COLOR=SlateGrey :confused: SUBJECT: A Repeating application error message. 1. Description of the problem: Several times a day while I'm working at my computer, the following occurs. I click on an icon or try the use Mozilla FireFox v1.0.2. The...


View more questions Search