.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

Close all form and terminate app in .net CF

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :Windows Application


I've been searching for a while for a solution to accomplish above subject, I have a win app for handhelds in which the user can navigate through several windows forms form.showdialog() The question is how to close all windows and terminate the app when user press exit button.

process.getcurrentprocess().kill(); --> didn't work
Foreach (Form frm in Application.OpenForms) --> doesn't work in .net Compact Framework

I mean if I use form.show() to open the windows, it works with Application.Exit();, but I want to prevent the user navigate away from the current form thru the icon for open windows on the right lower corner of the handheld, unless he press the close button of the form, that's why I use form.showdialog(), the other approach could be to show only the current open form of the application if the user press the icon for the open windows on the right lower corner.

Ideas welcome, thx

View Complete Post

More Related Resource Links

InfoPath form web part stops the close on submit

I have successfully published HTML browser enabled InfoPath 2010 forms to form libraries in SharePoint 2010. Users can navigate to the libraries and click new docuiment and fill out and submit forms, and the behavior of submit is as programmed in the form namely I have a concat rule for form name and chose action after submit to close the form with a success message. The problem I am seeing is a little abstract so stay with me while I explain. I'm hosting a number links to web part pages with the infopath web part on them. I use a links web part to aggrigate about 16 forms links on a single page. Users can successfully click on a link, are migrated to the web part page that has the form displayed in the infopath web part and all is well till they click the submit (on the ribbon, or custom button or whatever) The form does successfully get saved into the form library, but the form does not close. I need to make this process very simple for users without any training expended on the process. I'd like to shift focus to the previous web page, or close the form or something dramatic visually to show the user that they have completed the form fill out, and allow them to fill another form. Codebehind examples gratefully accepted! /Robin    

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!!

How to close a Form...

Hi all, i recently started C++.NET(CLR) and i cant seem to get Form1 to close after Form2 is loaded... after clicking ok button on Form1, Form2 is loaded properly but then i want Form1 to go away.. i tried almost everything, i included the header file of Form1 into Form2 but that just gave me around 6 errors saying that the instance i created of Form2 in Form1 was undeclared, then i removed that and just tried creating an instance of Form1 in Form2 load method but that also just gave errors... Help plz =/

how to close a form using Jquery

(1) how to Close a Parent Form2 how to close a child form(iframe)

how to close a form,subform,iframe and everthing using jquery


how to close a form,subform,iframe and everthing using jquery

how to close a parent form


how to close a parent form

close popup form and open again

when i click a button, then prompt another form and then i click close button at the upper right corner of the form
the popup form is closed
then i click a button again, then prompt a popup form again
but now when is popup form is prompt at second time,it always trigger form_closing event,why?
how to prevent it?

Programatically close web enabled form after submit


Hi all

I have an InfoPath 2007 form, which is web enabled and deployed to Forms Server 2007.

On the form I have a button. What I want to happen when the button is pressed is this:

1. My custom code behind should be executed. The custom code calls an external aseembly (common to ALL my InfoPath forms) which has a method that includes a dataconnection.Execute which will submit the form.

2. Close the form IF the submit went well.

Currently, I have a code behind and a rule on the button. What I am trying to get working is that the code behind sets a status flag on the form to "Success" and then executes the data connection. If an exception is thrown, I set the status flag to something else ("Failed") and rethrow the exception. In the rule of the button I then check this status field in the condition of the rule and if it is set to Success I close the form. What happens is, that the form is not closed uppon succesfully execution of the data connection. I am not sure in what order the code is run; Is the rule fired first or is the .NET code behind? It appears that the .NET code IS fired... and if the form was closed in the rule, then I wouldn't expect that to happen. So that means the rule is fired last. On the other hand the value set in one of the fields is not present upon validation of the condition of the rule, so tha

maximize, minimize and close buttons on the form should be invisible



I do not want to display the maximize, minimize and close buttons on the form.

How can i do this?

Are there any properties to make them invisible on the form?



how to specify file name and close the info path form on custom submit button?

i have submit button in the form once i click it must ask to enter the file name and once i given it it must close the particular browser tab.

how to specify file name and close the info path form on custom submit button?

i have submit button in the form once i click it must ask to enter the file name and once i given it it must close the particular browser tab.

Close current form?





I'm using the Fluent.dll control, and I want to activate the backstage view from another form, so I would usually do it with this code:



Dim objWin As New MainWindow()
objWin.MainRibbon.IsBackstageOpen = True


So basically I want to close the form that's open, and activate backstage in the other. For some reason though, this code doesn't work?!


Help! :)


How would I Close base Form when Calling a New Form

hi all, I have a login form and a Main Form. I want to Show Main Form after verifying user name and password. My written code is below (c# environment): this.Hide(); objMain.ShowDialog(); this.Close(); this.Dispose(); it's work fine. problem is when MainForm is activated, Login form still running in the memory (hidden). But i don't want so. I want free the memory by closing Login Form. If I use Show Method so total project's END. thing is happening here that, ShowDialog() Method hold the command and that's why other command are not executed. after closing Main Form other 2 line of code executed. I want to Close base Form before or after activate Main Form. Any help will highly appreciated. Thanks in Advance.

SharePoint popup close and refresh parent form



I am using MOSS 2007 and I have a requirement:

The user should be able to create a new quick link on a popup window.  So I have created a custom NewForm.aspx that is a popup.  Now I need that when the data is filled the popup closes and the parent form get refresh.

This is the code for the Save button:  <SharePoint:SaveButton runat="server" ControlMode="New" id="savebutton2" />

I am unable to place javascript in there.  I had been reading a lot of forum but still unable to find an answer.  Please let me know how to achive this.

Thank you




JQuery Validate plugin to validate a ASP.NET Form

The first time I used the JQuery Validate plugin, it did not work at all, see JQuery Validate odd behaviour with the ASP.NET Script Manager for reason, but perseverance and stubbornness prevailed and I finally created my first JQuery validated ASP.NET Forms contact form.

How to use getElementById to get the elements in a form

There are many ways of accessing form elements, of which the easiest is by using the cross-browser W3C DOM document.getElementById method. Before we learn more about this method, it would be useful to know something about the Document Object Model (DOM), the concept of HTML nodes or elements, and the concept of containers.

Each time you load an HTML page, the web browser generates an internal representation of the page in the form of an inverted tree structure. Let us look at a simple form. We will use this form later to demonstrate the use of the getElementById method.

Form view in ASP.NET


hi all...!
i have a database and i create a form with button edit,delete, New Registration..using Formview in asp.net..
everything was working good...

And i write SQL statement to get New ID number into dropdownlist/TextBox when i click button "New Registration".

i can get new(next) ID number after read database
it's also working good

Now i want change it to get ID which was deleted from table and replace the ID with new record...what i need is when i click "New Registration" i want get deleted "ID" first and then go to new record ID...

my code is here:-it working for get next ID after read database.

FROM Table1
AS boon WHERE PANG &gt;300000

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