.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to sync main thread and new opened window

Posted By:      Posted Date: September 14, 2010    Points: 0   Category :WPF
Hi all, I need to halt the main thread until some workflow is completed on the opened Window, the opened window has a user control content in which the user enter some data and click the button "next" . how can i halt the main thread and signal it to continue after the next button has been clicked? I've tryed using AutoRestEvent but the main thread get stucked and the window is frozen. ShowDialog wont help me, because i want to keep the window visible after the next button is clicked.     public void SomeMethod() { AppWizardStep2 step2 = new AppWizardStep2(ref myParams); Window myWin = new Window(); myWin.Content = step2; myWin.Show(); //Halt here // ...some logic that needs to continue after user workflow is completed on step2 user control }      

View Complete Post

More Related Resource Links

how to add content to a new opened window


Hi all,

i was working on a asp.net webpage and forms. this page contain a form, when user click submit, it will send a email to me. i use javascript to open a new blank window after clicking submit button: 

btnSubmit.Attributes.Add("onclick", "javascript:window.open(''); return false;");

now i want to add email content (some html code) into this new window, so it will display whats in the email to the user.

i have no idea how and where to add these codes. in the .ascx, or code behind file(ascx.cs) or i should make a new .js file?


i want to disable the entire parent window when the child window is opened?



 i am using the master page from the master page i am opening the child window.so, when ever i opened the child window i want to disable the entire parent window(all the controls present in the parent page) .how can we do it.


Burepalli V S Rao.

Part of Window content not minimizing with rest of Main Window.


I am developing an IDE-like WPF application.  The application's main window from the Microsoft  has a number of child tool windows and tabbed document windows. 

The layout system for the main window's child controls has been implemented using the Composite Application Library.

Recently, a problem arose in which two particular elements of the main application window did not minimize with the rest of the window.  Instead, these two child elements stay up on the screen.  However, I cannot actually click on the unminimized region.  In fact, I can drag items from desktop through the unminimized regions.  The only thing that I can think of that may be causing this is that the content that doesn't minimize is executing within a separate AppDomain.  The two UIElements from the different AppDomain are remoted from an Add-In (System.AddIn).

Has anyone else experienced a similar windowing problem?

How do you change the color of the main frame on a Window in WPF?


I have an application where all windows have a very custom look/feel.  When the user has their theme set to Classic, or even set to certain default themes, the colors clash with my main app colors.

Seems like it should be easy to set a brush on the Frame portion of a Window in WPF but this appears to be missing from WPF.

I have searched around, but the only solutions have found involve making the main window transparent and manually creating the border and drawing the frame yourself and handling all the sizing/move options yourself.  I got this to work just fine, however I have a window on which I need to use INTEROP to show an HwndHost on a canvas.

HwndHost doesn't appear when being used on a Transparent window, so I simply cannot make the window Transparent without making my app useless.

I have tried setting the WindowStyle="None" and that gets me close, but shows an ugly thin frame around whatever I put on the window.  I wish "None" really meant none..  Unfortunately, it doesn't.

Does anybody have any way to override the color of the main window frame without making it Transparent or setting the WindowStyle="None" ?

Please help me out with a code sample if you have a good solution for this?

Thanks a bunch,



Can not display the value in combo box from main windows in another secondary window.


Hi All.

I have a problem : I have main windows with bind to sql combo box. I want to display at the start of second windows selected value from main win combo box in combo box which located in second windows. I have code that does this but I'm having trouble when I bind combo box from second windows to sql. More than I have this code that displays the selected value from main windows but everytime first row in sql table because a code is selectedIndwx = 0 ;

How can I change the code to display the selected value from the main window and bind combo box at the same time.

there is a code.

Main window.

private void button3_Click(object sender, RoutedEventAr

Yet another User profile sync thread


I'm apparently in good company considering the number of posts, blog entries, and tech articles on trying to get User Profile synchronization to work yet are having problems.


I've been following this guide:  http://www.harbar.net/articles/sp2010ups.aspx

And this supplemental reading:  http://technet.microsoft.com/en-us/library/ee721049.aspx?ppud=4#accounts

And this on Kerberos:  http://blogs.msdn.com/b/russmax/archive/2009/10/20/configuring-kerberos-authentication-in-sharepoint-2010-part-1.aspx

And more than a couple additional resources.


Even with all that, I can't get my User profile sync to work.  I'm a rank novice with Sharepoint, but not new to I.T. systems but I'm at a loss of where to go next on this problem.   I have the small luxury of the system not being in production so I can do as I please with it, and I have VMware snapshots that I can use to roll back the servers to pre-install states.  That being said I need to get this figured out because the boss wants it in production before Christmas and My Sites, and profile sync are near the top of the required feature list.

I've got one system as the web server, and one as the database server (both 2008R2).  They're both essentially throw-away installs, but they are on our main live AD and network.

Threading - how can thread update a variable shared with the Main thread


I'm new to threading and have used it successfully, but limited.  I can spawn a thread and have the main thread reference variables in the spawned thread, but I don't know how to allow the spawned thread to reference (and update) variables in the main thread.

Any example threading code I've seen on the web appears to be WAY more complicated than what I do, so I am unable to understand or integrate into my code.

Here is a quick example of how I use threading:


public partial class ThreadVariableSharing : System.Web.UI.Page


Returning Exceptions from Thread to Main GUI and Throwing Modal Dialog Box


If I have a thread running and it encounters (and handles) an exception, how can I return that information to the main gui such that the Main Form can throw a modal dialog box?  Are there any obvious patterns for this that I'm missing?  Please include the code, if you can.

Modal popup window in ASP.Net

A Masked div or modal popup window is a child window created from the parent window which prevents the user from interacting with parent window before he returns to the parent application.

lossing focus from model pop up window controls


hi i using a model pop up window with some textbox but when i click on textbox of model pop up focus move to back to page textbox control plz help me 

Open PopUp Window From Error httpModule


I would like to open a popup window from the assembly to present the information to the user. Does anyone know if this is possible, I am presently doing the following:

        WriteLine("body {font-family:""Verdana"";font-weight:normal;font-size: .7em;color:black; background-color:white;}")
        WriteLine("b {font-family:""Verdana"";font-weight:bold;color:black;margin-top: -5px}")
        WriteLine("H1 { font-family:""Verdana"";font-weight:normal;font-size:18pt;color:red }")
        WriteLine("H2 { font-family:""Verdana"";font-weight:normal;font-size:14pt;color:maroon }")
        WriteLine("pre {font-family:""Lucida Console"";font-size: .9em}")

Create a user friendly pop up window


Hello friends I am new to asp.net programming. While working with windows form(windows application) i have created a window for editing purpose(just like popup window ) which contains three bounded dropdown list a button and a gridview. After making selections from the drop down when we press button the corresponding result should display in a grid.After that when you click on the grid row it will load the corresponding datas in my form. i want to create such control in asp.net . i have to use jquery or ajax.And this pop up window i have to use more than twenty times in my application.am using VS2008 ASP.NET and C# 3.5 . Plese suggest me what to do. Thanks in advance

problem in consuming WCF service through Window application


I have a silverlight application and WCF service all made in VS 2010 , i had hosted my site to web server which contain Window 2008 and IIS 7.0

now the problem is i have another application which is a window application developed in VS2008 , when i try to add the service reference it gives me error


The document at the url was not recognized as a known document type.

The error message from each known type may help you fix the problem:

- Report from 'DISCO Document' is 'There was an error downloading 'http://dev_qa.emspa.com/HRDev3/Service.svc?disco'.'.

  - The request failed with HTTP status 400: Bad Request.

- Report from 'WSDL Document' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from '' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from 'XML Schema' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

Metadata contains a reference that cannot be resolved: ''.

Content Type application/soap+xml; charset

Crystal Report parameter value window.


 Hi friends,

   I am using Crystal report which displays the result of stroed procedure which have 2 paramater.

  When i run report it shows two window for getting each parameter.

  My need is, can i have one window for getting all the paramter value for stored procedure.


  With Advanced thanks,






In Sync: Creating Synchronization Providers with the Sync Framework


The Sync Framework can be used to build apps that synchronize data from any data store using any protocol over a network. We'll show you how it works and get you started building a custom sync provider.

Joydip Kanjilal

MSDN Magazine August 2010

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend