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

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

Thread in WPF. continue processing while displaying a form dialog with progress bar

Posted By:      Posted Date: October 08, 2010    Points: 0   Category :WPF

I am devastated with this. pls help.

I have a main window which is doing file processing. I need to display a WPF form while this processing is going on.

I believe I will display this WPF form by calling wpfForm.showDialog()??

The problem is that when this WPF form is displayed, the processing is held until the form is closed. Even i call this from a thread. If i call it by Show(), then it lost focus and goes to the background if the main window is clicked.

What is the proper way of doing this? All the example i found from internet was about progressbar on the main window, not as a additional popup window.

pls help. thanks


1 + 1 = 3

View Complete Post

More Related Resource Links

form feild hints are not displaying for textboxses inside create user wizard?



I'm using following JS code to display input hint box besides the textbox whenever that asp.net textbox receives focus. 

I'm doing this for a registration form and all of the textboxes are inside the asp.net create user wizard control.

<script type="text/javascript">
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {

function prepareInputsForHints() {
	var inputs = document.getElementsByTagName("TextBox");
	for (var i=0; i<inputs.length; i++){
		// test to see if the hint span exists first
		if (inputs[i].parentNode.getElementsByTagName("span")[0]) {
			// the span exists!  on focus, show the hint
			inputs[i].onfocus = function () {
				this.parentNode.getElementsByTagName("span")[0].style.display = "inline";
			// when the cursor moves away from the field, hide the hint
			inputs[i].onblur = function () {
				this.parentNode.getElementsByTagName("span")[0].style.display = "none";

Closing Javascript Modal dialog window after server side event processing


Hello Friends..

Please tell me how to close Javascript ModelDoalog Window.. after Server Side event Processing .

Basically i want close window in  finally Block After sucessfulll Updation.

AMit..... InnocentInnocentInnocentInnocentInnocentInnocentInnocent

Data form web part not displaying - Unable to display this Web Part. ....



I am designing a data form - adding some formatting etc.  I am able to see the webpart correctly in SPD split view, but when I trying to preview it, it gives me the following error

Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Windows SharePoint Services-compatible HTML editor such as Microsoft Office SharePoint Designer. If the problem persists, contact your Web server administrator.
ANy help would be welcome, I have spent a lot of time on this page and don't want to do it again.  THere are a lot of fields and it's a tedious process to move them to the correct location.  I am at my wits end, I am not sure how to debug this!!


How to prevent thread form being stopped/aborted?

I'm not sure if it's a CLR related issue but at the same time i can't say it isn't. The problem is as follows: I have created a windows forms user control that spawns a thread(running a form). The thread is not a background thread and it's not supposed to exit until the form gets closed. It works as desired when the control is hosted in a windows forms application. The problem starts when i want to host it inside a html page. All works fine as long as the page containing the control is opened. Things get a bit weird when i redirect or close the tab(not the window; more tabs are opened). Exactly 1 minute from this moment the thread gets aborted. public partial class IEControl : UserControl { public IEControl() { InitializeComponent(); } private System.Threading.Thread t; private MainForm mf; private void IEControl_Load(object sender, EventArgs e) { GoThread(); } public void GoThread() { try { t = new System.Threading.Thread(RunForm); t.IsBackground = false; t.Start(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void RunForm() { mf = new MainForm(); Application.Run(mf); GC.KeepAlive(mf); GC.KeepAlive(this); } } I'm a bit confused at this point. Where could I get any information on this topic if it's not a CLR/GC related issue.

Change Text of Sharepoint Form Dialog title Bar

Hi, I am having Sharepoint 2010 RTM Trial on Windows Server 2008 SP2. I have published custom infopath form to sharepoint List. I have two views in that form, One is called AddItem and The other one is called EditItem. I have use the infopath rule to switch views depending on some condition and it is working fine. But when the view is switched to EditItem, I want to Customize the Title bar of Form Dialog to my custom text.... Can anybody have an answer ? Regards

Custom Edit form - close modal dialog and navigate to page

Hi, I created one custom edit form for my document library, replaced default save and cancel buttons with input buttons and added the form action to them. Then I set my page as default edit form. When I click edit button, my custom form opens in modal pop up. When I try to save the item by clicking new save button, item gets saved but pop remains as it is. Now, I want the modal pop up to get closed and navigate to page other than the parent page with some parameters after I click save button. How can I achieve this? Thanks!!

Difficulty displaying a PDF form in VS2010 (64bit)

In VS2008 I was able to display a PDF form (Adobe) from a button control.  Using the same process I am not able to display a PDF form in VS2010.  Does anyone have any suggestions?

Problem with displaying and processing dynamic data


I need to dynamically generate a list of images in table format.  The images can be found in either art or picts, in temp, or in temp and in one of the other two (duplicate image). 

The idea is to display any duplicates prior to copying anything over from temp to either art or picts, so I'm thinking of adding radio buttons if the same image is found in two folders.  I also want to add a submit button.  The user selects the image they want and clicks the button.  If they want the new file it's copied over then deleted.  If they want to keep the existing file the new one is just deleted.  If they select nothing, both versions of the file are deleted.  So the table will look something like this:

temp         art            picts         process
z-123                                           delete button
() z-234                       () z-234  

How to hide form from Alt-Tab dialog


I'm creating a borderless form by setting this.FormBorderStyle = FormBorderStyle.None

When I show the form, if users press Alt-Tab to switch among applications, they can still see it. How can I disable it ?

Thanks a lot.

progress bar while uploading big form


Hello, im looking for long long time for some article / code for my issue. i have in one page of my site big form (like an order form) with the user details (name, phones, email, etc) + he can upload 1-15 files + some more and more textboxes. at the end there is a send order button that handle the data (to sql database with code behaind, C#). The form is working fine!!! i just want to show the user some precents progress window or something like that so he will follow the progress. any idea??? (please dont send articles that show gmail upload style - the progress need to deal the all progress not just the files)

Custom Task form of a SharePoint Designer workflow is not displaying correctly


We have created a custom workflow using SharePoint Designer. We are using one action “Collect Data from a User”. As you know, this action sends an email to a user with a link to a task form where user is supposed to accept or reject a request. We are encountering following issues with this form:

  1. Form is not a workflow form, it is a task item of the task list that the “Collect Data from a User” action of the workflow creates.
  2. Form opens as an item of the workflow task list in View mode (DispForm.ASPX) instead of Edit mode (EditForm. ASPX)
  3. When user clicks on “Edit Item” button, it displays all the fields of the task as editable – we want only the Approve/Reject option buttons and the comments TextBox (that we created during the workflow design) to be displayed as editable

Can someone please explain what is going on and how can we resolve the above issues?

Display a form as a dialog and then display a messagebox on top


This is the code in my form1

public partial class Form1 : Form
    public Form1()

    private void button1_Click(object sender, EventArgs e)
      using (Form2 dialog = new Form2())
        var result = dialog.ShowDialog(this);
        if (result == System.Windows.Forms.DialogResult.OK)
          MessageBox.Show(this, "Test", "Test Caption", MessageBoxButtons.OK, MessageBoxIcon.Error);

And this is the code in my Form2

public partial class Form2 : Form
    public Form2()

Closing a WPF form from another thread?? The calling thread cannot access this object because a diff


I have a WPF form with a Close buttom which just does


I also have a public method in this WPF form which goes like this

public void doClose()

doClose() is supposed to be called by other classes but I keep getting this runtime error when this method is called:

The calling thread cannot access this object because a different thread owns it.

Please tell me how to solve it.



1 + 1 = 3

"launch form from a dialog" - why not in lists web parts?



SharePoint 2010 enables open a list item as a pop-up window (that's the default, deined in the list settings as "launch form from a dialog" which is set to yes). That's great, but:

when i'm display the list view in a web part (for example annoncement list in the home page) - that functionality seems to be missing :(

the item which is clicked is opened in a full window... any place to configure that it would open as the same way it's open from the list view (as a dialog)?


keren tsur

InfoPath form not displaying after submitting


I created a new InfoPath form and published it to my Team SharePoint site, allowing InfoPath to create the form library.  The issue I am having is when I submit a "New Document" the completed item does not display on the site after I click submit.  The only way I can tell the item is there is to go to "View All site Content" and there I can see a count of how many examples I have submitted.  I am not sure why the submitted items will not show.  Any  guidance in resolving this issue would be greatly appreciated.


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