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

Post New Web Links

Form Opens with same size as when closed

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :Windows Application


Using VS 2008 WinForm.

I've noticed that most applications will reopen the same size as when it was closed. For example, if the application was maximized when closed, it will reopen maximized. How do I achieve this?




View Complete Post

More Related Resource Links

Windows Keyup event is routed to next form even if the current form is closed

In a form (say FormA) i have 2 events "Keyup" for the form and button_click event for the button. I call FormA from the main form with a showDialog, after this i call another form (say FormB), it also has the 2 events. In both the form the button_click event has the logic to close the form (this.close()). Now when the FormA is opened the focus is on button, if the user presses "enter" button the button_click event is called which closes the form, the logic returns to the main form and the next line i.e. to open the FormB is executed. Now here is the wierd part, in FormB because there is a KeyUp event handler; just after instantiation of the form directly this event handler is called. I guess this is being routed from FormA. Shouldnt the FormA's keyup event be closed as soon as the form is closed?

error while openning infopath file + "The Form has been closed."



I have restored the "Infopath" library from production to staging server

and when i tried to open the InfoPath form template(i.e TestFile.xsn file), but i am getting below error "The Form has been closed."

Actaully when i saw the log in 12\log folder, the error is given below

"10/07/2010 06:20:59.47  w3wp.exe (0x1A10)                        0x1740 Forms Server                   Forms Services Runtime         8ged Medium   MetaInformationByUrl:CrossSite check failed for site URL=http://mysitestaging/teamsites and file URL=: http://mysite/teamsite/formservertemplates/research%20request.xsn "

Please help me to solve this issue

Windows Form getting Closed Automaticaly


I am having a WinForm application.

Recently I observed a strange behavior that one of the Forms that I open using showDialog() is getting closed automatcailly.

Any pointers on how do I tackle what is closing the window?

On Visual Studio, I enabled catching all exceptions (debug->Exception and turn on ALL)

I dont find any unhandled exceptions.

In the stack trace, you can see this frame : IMsoComponent.FContinueMessageLoop()

I found a lot of people having similar issue of automatic closing form with having this call in the stack trace.

here is the stack trace:



>    TAMES.Noticing.dll!TAMES.Noticing.UIForms.EditHandlerForm.EditHandlerForm_FormClosing(object sender = {TAMES.Noticing.UIForms.EditHandlerForm, Text: Error!}, System.Windows.Forms.FormClosingEventArgs e = {System.Windows.Forms.FormClosingEventArgs}) Line 134    C#
     System.Windows.Forms.dll!System.Windows.Forms.Form.OnFormClosing(System.Windows.Forms.FormClosingEventArgs e) + 0x77 bytes   
     System.Windows.Forms.dll!System.Windows.Forms.Form.CheckCloseDialog(bool closingOnly = false) + 0x8c bytes   

AJAX web form size


We have developed an ASP.Net 3.5 application which includes a form for the user to fill in and submit to the server. The form contains some 40 controls or so (mostly textboxes, drop down listboxes, and some custom web controls) which are being validated (some using Custom Validators and server-side logic). To make the user experience feel like a connected session we have used AJAX (a ScriptManager and an Update Panel containing all page controls.)

Although the application is performing quite well when deployed onto a LAN environment, when published onto the web, the users experience long delays (some 20 seconds to refresh the page or to have validators check each control); for slow link users, this can take up to a minute or more.

After investigating the issue a bit, I discovered that if I save the page from the browser, it saves some 600K, most of which being some 13 ScriptResource.axd files and a couple WebResource.axd. I have no idea of what these are, but I suspect they are AJAX javascript libraries..

By removing the ScriptManager from the page, I get the page size to a more reasonable 90K size.


Can somebody please explain to me why this is happening? Is there a way to minimise my page size and still use AJAX?



Info Path Form Problem; the form is closed


Hi All

I am facing an error in info path form web enabled.


When i open a new form, it opens and saved. Even the sendingemail is also working.

But when i try to open the already saved form. The form is not opening it is displaying the error that the form has been closed. Or it is not getting the form from the location..

Closed form designer window in VS 2008, now cannot open again



I closed the Form1.Designer.vb tab in VS 2008.  If I click on Form1.vb in the Solution Explorer the View Designer button does not appear.  How can I open the designer window again?

lost updated data after form is closed



I have a form thru which I add new user and/or edit users list. Adding a new user is okay. Edited data is also saved with the update tableadapter.update method, but as soon as I close the form, the data is set back to the original values. (However new records are there). Data is stored on table "Users", which is part of the "Database.sdf".


Please help, how can I save/update the values for existing items.


Error: The form has been closed



Using sharepoint explorer view I 'cut-pasted' a form into a form library, then I assigned unique permissions to that form item. But whenever I click the form item, I get the following error: "The form has been closed". Also, the same form when opened by the creator or sharepoint admin works opens properly but if a user (with contributer level permission) try to do the same; the mentioned error occurs.

The form item is a duplicate of an existing form with unique name but same form (item) permissions and other related attributes.

Question: Am I missing something here? What can I do to open these forms properly?


adding scroll bar & increase the size of form

I'm using visual basic in visual studio 2010. I am a begining designer.
I created several columns in form. In columns there are many textboxes for input.
I like to create a scroll bar in each column, but i don't know how to create it.
Also Can I increase the size of form since I need to put lots of textboxes

Users with permissions cant open or edit form - "The form has been closed"


Dear All,

I am facing this unique problem. Some users in my company's SharePoint portal network despite user permissions, cant open their previous forms or add a new form. Just for testing I also tried giving one of the users full rights, but the problem persists. I am using infopath web based forms.

Following is the error when the user opens up a form:

" Form has been closed"

Upon checking the SharePoint error logs. I found following error message

The form template failed to load. (User: Litware\max.steve, Form Name: Expense, IP": , Request: http://portal/_layouts/FormServer.aspx?XsnLocation=http://portal/hr/Expense/Forms/template.xsn&SaveLocation=http://portal/hr/Expense&Source=http://port

Submit InfoPath Form Attachments one after another. Avoiding Sharepoint 50mb size limit


As the title says. How would I make an infopath form submit an attachment, then after being submitted; Submit the 2nd attachment, and so on.

The problem I'm running into is the 50mb file attachment limit in SharePoint. It is not an option to change this Max amount. This way the 4 attachments which are all around 15 mb, won't total 60mb at one time and go over the file size limit.


Getting InfoPath Error "Form has been closed"


Hi All,

I am getting following error message when I try to click new button on InfoPath Form Library

" Form has been closed"

Upon checking the SharePoint error logs. I found following error message

" The form template failed to load. (User: Litware\max.steve, Form Name: Expense, IP: , Request: http://portal/_layouts/FormServer.aspx?XsnLocation=http://portal/hr/Expense/Forms/template.xsn&SaveLocation=http://portal/hr/Expense&Source=http://portal/hr/Expense/Forms/MyItems.aspx&DefaultItemOpen=1, Form ID: urn:schemas-microsoft-com:office:infopath:Expense:-myXSD-2010-06-07T06-23-34, Type: SqlException, Exception Message: Invalid object name 't6_sco'.)    f6c21a52-df06-4e6d-ad0b-756318f22791 "

Any idea how to solve this problem ?


P.S: This problem is occurring with only one user "max.steve". Every one else in the company is able to open the form.

FYI: I am using InfoPath 2007 web based forms deployed on Microsoft Office SharePoint Server 2007



Muhammad Tariq khan

Adding Approval WorkFlow to InfoPath Web form "This Form Has Been Closed"


I have used the following link:



I can view the form, create a new form and publish the form to the library on submit.  However, When I try to create an approval WorkFlow on the site, I get "This Form Has Been Closed". 

I have a task list created and I have the form library set up to display web part pages. I published the form from the main SharePoint server.  How can I add a workflow to this Web Form?

Search results Form was closed error


I have an infopath form that opens fine when you navigate to it or copy it down to your desktop but when I use the search and click on it from the search results I get 'form has been closed'


This only happens on a couple infopath forms and I an cannot figure out why... When I hover over the document the url appears correct.


Any Ideas?  Thanks in advance.

Reduce ASP.NET Page size and complexity using JQuery

This is my first post on asp.net blog. ASP.NET Ajax and JQuery are two different ajax framework. In this post I will show, how we can enhance gridview using ASP.NET Ajax and JQuery. I also compare the implementation of these frameworks. In next posts i will explain more about JQuery and ASP.NET Ajax and also tell you "How to combine the power of both framework". My Future post will related to ASP.NET and related frameworks.

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