Forms Retaining Values After Closing

Jan 4, 2011

Throughout our program, forms are opened like this[code]...

The problem is that when forms are closed, they seem to not really be closed, only hidden - if I add some text to a textbox and close/reopen the form, the text is still there, rather than the textbox being cleared like normal. This is presumably because the form always uses the same instance.

Is there any easy way to fix this other than going through the entire program and creating a new form instance for every ShowDialog() call (there are hundreds)?

View 4 Replies


ADVERTISEMENT

.net - Datalist Not Retaining Values On Postback

May 20, 2009

I have a datalist control that is not retaining it values during postback when the control causing the postback is outside of the update panel that the Datalist resides in. I have verified that viewstate is on for that usercontrol as well as all its parent controls. My basic situation is that I have a Datalist that contains a user control on a page. When the user selects several rows in a grid and presses a button, a datatable is filled on the backend and assigned to the Datalist which has its item template set to the UserControl.

On ItemDataBound I set specific properties in the control which customize the messages on that control to the specific item. This is then popped up using the AJAX Control Toolkit Modal Popup[ Extender. When the user presses Save the whole page posts back. Data is collected from the user controls and saved to the DB and the popup disappears. The issue I am currently having is that the DataList has 0 items when the save button is pressed instead of the appropriate number. THis issue just started appearing after we upgraded from .NET 2.0 to .NET 3.5.

View 1 Replies

Forms :: Retaining Data Across Multiple Forms

Sep 8, 2010

VB.NET newbie here... I have an vb.net windows application set up. It has multiple forms, about 6 in all. There's a main menu form, and then 5 other forms to collect data. The user will collect data on each form and bounce back and forth between forms. How do I get the forms to retain the data that has been entered into the text boxes and/or other controls on the forms? For example, they might fill out a few textboxes on a form, but then need to go to a different form and fill something out... and then back to the previous form. Right now, when they come back to the form, all the data previously entered in to the text boxes is gone.

View 1 Replies

Excel - Retaining Array Values Between Procedures

Feb 17, 2012

How do I effectively declare a Global Array which I can access the values of that array from any procedure? I have a Userform from which I will call various sub procedures depending on the actions performed on the useform. I have one procedure (Procedure1) where I have set up a multidimensional array and input values to it. I have another procedure (Prodedure2) where I want to access the values in the array - I DO NOT want to pass the array values directly from Procedure1 to Procedure2.

View 5 Replies

Unbound Datagridview Column Not Retaining Values?

Jan 10, 2011

I have a DataGridView bound to a binding source. I have also, however, added an unbound column in which I plan on putting numbers calculated from the bound columns. The problem is, Any time I edit my unbound column (on any row), the value doesn't stay. If I programmatically edit the values, they never show up. If I type in the cell, then upon hitting enter or clicking outside of the cell, whatever I typed disappears.

View 1 Replies

.net - Not Retaining Changes Made To Values Of Properties In A Custom Class?

Jun 10, 2011

I created this function to remove vbCrLf from the values of properties in a Custom Class:(vTransaction)

Public Function ValidateTransaction(ByRef vTransaction)
Dim property1 As String
Dim value1 As String
For Each p As System.Reflection.PropertyInfo In vTransaction.GetType().GetProperties()
If p.CanRead Then

[Code]...

Throughout testing I can verify that vbCrLf is being replaced with a space as expected. When I re-examine vTransaction the changes have not been retained and the vbCrlf's are still there. What do I need to do to retain the changes being made to values in vTransaction.

View 1 Replies

Closing Application Via X Button Without Closing Forms Inside Mdiparent Causes Exception Error

May 3, 2010

Form1 is a mdi container. It has a bunch of forms that can load inside of it as mdi children. If I close each open form inside the form1, and then click the red X at the top right, application exits fine.If I click the red X without closing the forms inside I get: An unhandled exception of type 'System.CannotUnloadAppDomainException' occurred in mscorlib.dll

Additional information: Error while unloading appdomain. (Exception from HRESULT: 0x80131015) However I can break from it. How do I get the application to not show that error? What must I do to fix those inside forms or close when the red x is clicked?

View 1 Replies

VS 2008 Closing All Forms When Program Closes Vs. Closing All But Main Form

Jun 4, 2010

Dim frm As Form
For Each frm In Forms
Set frm = Nothing
Next frm

The above code is what I used in VB6 to close all forms associated with my programs before my program closed. I have been searching for information on how to make sure all forms are closed when closing a VB2008 program.

I have seen info on using the Project Property Shutdown mode When startup form closes and I currently have this set.

Is this all that is really necessary? Will the garbage disposal close everything else to free up RAM?

Also, if I have several forms open and want to close all from the main form without closing each one individually, what is the best approach? Is there a collection like in VB6, go through the collection, compare it to the name of the main form and close it if it is not the main form?

View 4 Replies

Forms :: Multiple Forms, Closing Events And Sub Routines?

May 25, 2010

I have googled high and low to find an answer to this but I must be searching wrong.I have an application which has a listview displaying some items that are stored in a SQL Compact database. I am using a second form to add new items to this list directly into the database.When the second form closes I want to call the sub in my first form to refresh the list from the database.

How can I get it to fire the form1 sub routine on the close event of form2

View 3 Replies

Forms :: Closing Forms On MenuClick From Module?

Dec 13, 2009

Im running a program with multiple forms with a menu and toolstrip defined and assigned with properties in a module. each form has the Call menuload (Me) in the form_load sub.

My problem is that these menu's have menuitems which need close the shown form and open another. a sample of one of my menuitems is:

Module MenuTemplate
Friend WithEvents frm As Form
Friend WithEvents menustrip As New MenuStrip

[Code].....

View 14 Replies

Add Strings And Keep Their Values After Closing?

Aug 17, 2010

In my program, I require to have an essentially unlimited number of strings that I can keep their values after the program has closed.

View 6 Replies

Forms :: Two Forms Application Is Closing

Dec 12, 2011

I have two forms and a button on the first form. What i want is when i click the button the second form to show and the first one to close. But this isn't working with: Form2.show() Me.close All the application is closing with the code above.

View 4 Replies

Save Listbox Values When Form Is Closing?

May 23, 2012

How Do I Save Listbox Values When Form Is Closing? and how do I load saved listbox values when my form opens again? Listboxes just don't seem to want to save. I suggest trying it out before posting unless you know the answer because simply using property binding in the applications settings doesn't want to work.

View 3 Replies

Closing Old Forms?

Jul 5, 2009

Here is my problem: when I create a new form i want to close the old so it is not still running in the background. As in if the were to move on to a second form and the X-out the first form would still keep the program running. Normally i would do [me.close] and when that didnt work i tryed [me.form1.close] and then [dim frm1 = form1 frm1.close] with no luck. Could some one please tell me where i have gone wrong?

View 5 Replies

Forms Not Closing When They Should

Apr 20, 2010

i have a problem with trying to get 2 forms to close at different times using a timer on each of the 2 forms.This is my form layout:frmMainFrm1 Frm2..Frm1 and Frm2 are identical to each other. FrmMain has 2 buttons on it. One button to call Frm1 and the other to call Frm2.Frm1 and Frm2 each has a timer. It counts down to 0 and then does a .close(). However, if i pause between clicking the second button they both seem to always disappears at the same time.then they both disappear at the same time.... which shouldn't happen since i clicked the Frm2 box 10 seconds AFTER Frm1... So Frm1 should hide before Frm2 does...but it does not.

View 4 Replies

Forms Not Closing When They Should?

Apr 21, 2010

i have a problem with trying to get 2 forms to close at different times using a timer on each of the 2 forms.

This is my form layout:

frmMain
Frm1
Frm2

Frm1 and Frm2 are identical to each other. FrmMain has 2 buttons on it. One button to call Frm1 and the other to call Frm2.Frm1 and Frm2 each has a timer. It counts down to 0 and then does a .close(). However, if i pause between clicking the second button they both seem to always disappears at the same time.I would do something like this...

Click on the first button (showing the Frm1 form)
wait about 10 secs...
Click on the second button (showing the Frm2 form)

[code]......

View 2 Replies

Closing Unactive Forms?

Sep 13, 2008

, When you hit esc a 2nd form comes up on top of the first. On the second form you are able to close the first or/and reload the first with different info. My problem is whenever i try and reload the 1st frm it doesn't close it just opens it again. So if i do it seven times i have seven windows of the first frm open... my codes is something likes this

Dim frm1 as new form1
frm1.close()

From what i was thinking it has to do with the "New" Part in the dim statement....

View 2 Replies

Forms :: Form Not Closing?

Nov 6, 2009

In my one form I have a cancel button whcih is supposed to the form when the button is clicked. But its not closing the form. What could be possible reasons. I am using VS2008.Net3.5

The code is:
Private Sub cbCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbCancel.Click

[code].....

View 7 Replies

Replacing Forms Without Closing?

Aug 9, 2009

i have a form (form1 for example) and there is a button ( button1) and too many controls in this form and i have form(form2) and too many controls in this form
i want when i click the button1 i need every control in form1 to disappear and instead i want form2 and it is contents to be loaded in the form1

OR

the second form is showing without the user noticing that there's too forms
(replacing)

can i do this and if i can't , can i create a custom control/controls to do this
and if i can how can i do this?

View 6 Replies

Closing All Forms Within Mdi-Parent Form?

Jun 21, 2010

How will i close all the forms within my main form? Everytime I click on the menus of my main form,I'm setting my main form as MDI-Parent form and then loading a new form as it it is the child form if I'm not mistaken. I have a log-out menu, and what I want to happen is everytime I log-out all the forms within my parent form will be closed. How will I do it? Here are some of my codes.

[Code]...

View 3 Replies

Closing Multiple Forms At Same Time

Feb 21, 2010

I have two child forms that open from the MDI Parent.My question is when I close one of the child forms all others will close also.

View 2 Replies

Forms :: Closing A Form In A Panel

Aug 3, 2011

Iam a beginner to vb.i have a project work,related to Quotation software.i want to know how to unload all forms that are loaded on to a panel when clicking a Button.here i did some codes, in that, one error is displaying like "Collection was modified; enumeration operation may not execute." the code is given below:[code]

View 1 Replies

Forms :: Closing And Re-opening The Same Form

Feb 22, 2010

I am attempting to find a way to get an existing form to close and re-open (with the controls re-set). If I use a method like

[Code]...

View 4 Replies

Forms :: Confirmation Of Form Closing?

Mar 27, 2006

I want to do something like when click on the close button, a message box will pop up and if yes, close it else remain in the same form. But the following coding seems only consider one side while the other side is ignored.

Style = MsgBoxStyle.DefaultButton2 Or MsgBoxStyle.Question Or MsgBoxStyle.YesNo
Check = MsgBox("Do you want to quit?", Style, "Exit confirmation")
If Check = MsgBoxResult.Yes Then
Application.Exit()
End If

View 8 Replies

Game Programming :: Closing Forms By Name?

Feb 18, 2009

I have an application that create forms and name it randomically. I would like at certain point, to be able to close one or more forms from the main window application.

View 4 Replies

VS 2010 Unable To Closing Forms?

Feb 12, 2012

I have noticed when I close a form I have invoked using form.showdialog the form does not appear to be totally removed. If I load a value into a textbox and press my cancel button [Me.close() Return] and then reload the form the value in the textbox is still present. Also bindings are failing because they are already set up

View 10 Replies

Cannot Display New Information In DataGridView Without Closing One Of Forms

May 3, 2009

I am currently working on a school database that I am having troubles with. I have the Table Adapters, Binding Source, and DataGridView all working, along with the Insert, Update and Delete Commands. I have the user open up the SubjectForm. On this form the user is looking at a DataGridView of the subjects table and everything that is in it. When the user clicks add new on the right side, it opens up a new form called AddNewSubject. When the user gets done adding the new subject in, a dialog box appears and says that the subject was added successfully. After the user clicks exit, it takes them right back to the SubjectForm where the DataGridView is. My question is, how do I update the data in that grid so that after the user clicks exit on the AddSubject Form, the new data will appear in the grid? I have tried a combination of things and they haven't worked. I will add my code at the bottom.[code]....

View 10 Replies

Forms :: Sub Call To Form Closing Event?

Mar 21, 2011

Going around in circles here. I have an Exit button (Barbuttonitem6) on my form and would like the FormClosing event to handle this. The code works fine for the FormClosing event but when i try to call the Formclosing event from Barbuttonitem6, it does not work (The form does not close if i choose Yes to save or No)

Public Sub BarButtonItem6_ItemClick(ByVal sender As System.Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem6.ItemClick

[code].....

View 2 Replies

Forms Not Closing ( Form.ShowDialog(), .Close() )?

Oct 12, 2009

I am creating a VB program that has a Main class, and 4 windows forms. Each of the forms has a back and a next button to navigate trough the forms. The problem is that when I hit next (Here is the code)

Private Sub continueButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles continueButton.Click

VS 2008 Remember Textbox Text when Form reopens

View 8 Replies

Rules/Guildlines For Closing Vs. Hiding Forms

Jul 16, 2009

I was wondering what Rules/Guildlines poeple for Closing vs. Hiding forms?

example:Should i only close a form when i am finished with it?

View 9 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved