Retain Value In Variable After Application Closes?

Apr 22, 2009

I want to retain a value in a variable even after the application closes so the next time i open the application i can get that value.It's actually an integer value, i want to count the no. of times the application has been opened. I tried using static [b] but it doesnt work.

View 8 Replies


ADVERTISEMENT

Edit And Retain Variable Value?

Apr 15, 2009

I'm trying to write a small program to produce costing quotes, so I thought I'd assign variable to all of the individual costs, problem is the cost of things change as we all know. So I set up a dropdown box listing costs a textbox and a button... Idea being ...

Exit Sub
ElseIf MaterialsCMB.Text = ("White Vinyl") Then
wvCos

[code].....

View 12 Replies

Retain TextBox Line Breaks In Winforms After Assigning Text To A String Variable?

Oct 3, 2011

I have a WinForms app with a multi-line textbox. This displays and retains (after loading from the DB) line break characters fine. However if I assign the TextBox.Text value to a string variable and then re-assign the variable back to the TextBox.Text property, the line break characters are lost and replaced with a square character (can't past them here as they just paste as a line break!)

[Code]...

View 3 Replies

Adding A Variable That Will Persist When The Program Closes?

Jul 26, 2011

Sorry for the extra long title, Here's what I want to do.I want to give the user the option of using or not using specific features of the program.If I can set a simple yes or no value that wil persist each time the program run and then depending on the variable turn off or on the feature at start

View 14 Replies

VS 2010 When The Client Closes Sockets The Server Closes As Well

Apr 9, 2012

I have a small problem with sockets (I'm new to sockets). Below is the code I'm using. The problem is that when the client closes, the server closes aswell. How do I stop it from doing that?

[Code]...

View 1 Replies

Detect If .net Application Closes?

Nov 15, 2011

I've been looking around the internet and I haven't really found any solution to my problem. Is there a way to perform a function when a user closes the form either by pressing the X button in the top right hand corner? I am using a database that saves what form the user is currently looking at, and when the application is closed I want to say "offline."

View 4 Replies

Application Closes After Uploads File To FTP?

Mar 28, 2010

I created an app and what it does is takes a screenshot of your desktop, saves it, then uploads it to ftp. After that it closes. What i need it to do is continuously do that via what ever the interval is set to. So if the timer1 interval is at 12000 then i need to to take a screenshot and upload it every 12 seconds. Can someone tell me why is keeps closing after it uploads the 1st screenshot? [code]...

View 3 Replies

Application Closes When Close A Form?

Apr 6, 2009

I have a problem here I hope someone can help me out. I have this application in which I show information about workplans. It has a Main Form which show the general information and the activites that are going to take place during the execution.

The application has the ability to "attach" documents to the activities. I have created another form (and MDI form) that I use to show the documents (pdfs) when a user clicks on one of the documents attached. The problem is that when I close the form that shows the documents, it ends the application and I don't know why. It should just close and leave me again with the Main Form. Can someone tell me why is this form terminating the app. Is it because is MDI or what?

View 4 Replies

Update Table When Application Closes?

Oct 27, 2010

I need to update a table when my application closes. This is with the user name of the person exiting the app.

This works fine when the user closes the form from the main menu exit button where I have written code to update the table. However if a user exits from another form the main form is not closed (as I thought it would be) and the code that updates the table consequently does not run.

I have tried entering on other forms under the FormClosing event but this does not seem to run if they click the X in the corner of the form.

How can I get that code to run when a user exits in some other way.

View 1 Replies

Closing Child Form Closes Application?

Aug 16, 2011

I've made a Windows Forms Application that runs fine. It has some buttons that open child forms, which can simply close again without any problem. As I need the form to be in a dll, I changed the application type to a class library and added an extra project containing an exe-file that only references the main form in the dll and shows it. So far so good...

The main form is basically a tabcontrol with a bunch of controls, buttons among others. Five buttons on different tabs use the same handler to open a child form. When I click the button on the first tab everything works fine. The form opens and when it closes, only the child closes. When I click any of the buttons on the other tabs, the child form opens and when it closes again, both the child and the main form close...

I am stumped, especially since all buttons use the same code to open the child form and everything appears to be completely identical, yet the results are not. Below I have pasted the code that opens the main and child forms. I am undoubtedly not looking in the right place, but I also have no idea where to look anymore, let alone what to look for...

The code opening the main form:
Public Sub StartProgram()
'Load the form and show it
Dim frmProgram As frmMain = New frmMain

[Code].....

View 5 Replies

Process Doesn't Exit When Application Closes?

Nov 6, 2009

I published my ap, and installed it on my pc. Now, I run it and it works great, however when I close it the .exe doesn't end...

View 3 Replies

Reopen A File Immediately After It Closes Via My C# Application

May 18, 2012

I ran out of ideas and couldn't find any reference about it so here I go... I need to keep a secondary application wich is not related to my c# project always running in background. So if this secondary application crashes or someone else close it manually it will automatically re launch again via my c# app.

I have no clue of how to accomplish this one, I mean checking if this application closes by something external to my c# app.

View 5 Replies

Disable Validation On All Forms When User Closes Application?

Feb 26, 2012

Is there an easy way to disable all form validation when the user clicks on the "X" icon to close an application or when the user clicks on a button in the application that closes the application?[url]...

View 1 Replies

Form_closing Dialog - Application Closes When User Click No

Mar 6, 2012

I have a parent form and a few subforms. When the user clicks the red X to close the form I have a dialog box open that asks the user if he wants to exit the application. I have a issue when the user clicks no the application closes anyway. I am wondering what I am doing wrong. [Code]

View 8 Replies

Retain A Value From A Textbox And Add To It?

Nov 15, 2011

My assignment is to create an application that allows the user to type an item's price into a single textbox, add the price to the previously entered prices, and display the total charge which includes a $15 shipping charge and a 3% sales tax.Example: I type 10 in the textbox and click calculate. the subtotal (before tax and shipping) reads $10. Next, I type 20 in the textbox and click calculate. The subtotal should now read $30.I have everything working fine except adding the different prices. I cannot figure out how to retain the value of the subtotal and add it to the next value entered.

View 2 Replies

Add / Remove Items And Retain?

Aug 20, 2010

I am using ListViews for easy drag-n-drop, But I need the User to be able to 'permenantly' add or remove items.[code]...

View 3 Replies

Retain Checkedstate Of A Listbox?

Sep 20, 2010

I am populating a listbox from a table called "TableA" and if item is checked in the listbox it is saved in another table called "TableB"

For i = 0 To listbox1.Items.Count - 1
If listbox1.GetSelected(i) = True Then
rs.addnew ..........' (in TableB)

[code].....

View 10 Replies

VS 2008 Hwo To Retain A Vlue

Feb 24, 2011

i have to retain my values so i can use it again but somehow it wont work in my case.[code]

View 18 Replies

Forcing A PictureBox To Retain Its Image?

Oct 7, 2009

My pictureboxes sometimes clear of all drawings when they are done creating the image, or sometimes halfway through. Calling GC.Collect() before the drawing starts lets it draw MORE before it clears, but how can I stop it from clearing entirely?

View 2 Replies

How To Retain Data Across Multiple Forms

Sep 8, 2010

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

Retain Edited Textbox Value After Submit?

Nov 24, 2011

I reloaded ny page with previous data that was available for my login.Now i try to edit the textbox and update .It either updated or doesnt retain the edited value in Textbox.[codd]e...

View 2 Replies

Retain Values In Select Multiple Box?

Oct 28, 2011

I have a javascript function below to move from select multiple box A which is populated from database to another multiple select box B, in the event of a postback my values in B which are moved over from A got lost. Initially I thought because I included a "runat="server"" tag for server side actions but apparently it's not the case. I read about Form.Request but ain't have a clue how to go about it. I just need to retain those values in multiple select box B.[code]...

View 1 Replies

Unable To Retain Data In DataRepeater?

Nov 24, 2009

I am manully adding data to DataRepeater, but once scrolling up and down, the data is vanished. I have only a text box in the item template.

DataRepeater1.AddNew()
DataRepeater1.CurrentItem.Controls("txt1").text="yehaa"

View 3 Replies

Asp.net - Change And Retain DIV Selected Tag In Master Page?

Oct 24, 2010

I have a CSS class called selected which highlights the DIV as the current step. When they're all in separate pages, I just had to move the selected word to the next DIV.But how can I achieve the same in Master Page VB .Net? It seems to be one page for all. When the next page loads, how do I get it to highlight the next step?

[Code]...

View 1 Replies

Use The Tab Key To Exit And Retain Current Cell In DataGridView?

Jan 26, 2012

In my form there is a DataGridView, the user select information in the DataGridView then there are text boxes that needs to be filed in. So this is what needs to happens if the focus is on the DataGridView when the user hits the Tab key it moves the focus to first text box. Then once the user hits the last tab box it returns focus back to the DataGridView but to next cell. Initially figured this would not be a problem and did this code;

Dim PreviousCell As DataGridViewCell
Private Sub DataGridView1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles DataGridView1.KeyDown

[code]....

View 3 Replies

Allow Labels In Disabled Panels To Retain A Their Prominent Forecolor?

Oct 19, 2011

I need to allow labels in disabled panels to retain a their prominent forecolor. So, I am considering replacing all labels in panels that become disabled with LinkLabels. By disabling the control and setting its disabled color to black it holds the color. However, I have always been of the opinion that one should use the lightest control possible.

View 3 Replies

Display CheckedListbox Values Into Listbox2 And Retain CheckedState?

Dec 13, 2010

What i am trying to achieve is that if listbox2 contains checkedlistbox1 items then checkedlistbox1 should retain checked state even after the from is closed and re-opened again.

Since i am saving the checkedlistbox1 values into a Table - is it possible to bind those to retain the checked state even after the from is closed and re-opened again - or it can be done comparing the values from both listboxes [code]...

View 2 Replies

Retain Executing Thread's Context During Call To QueueUserWorkItem In ASP.Net?

Nov 17, 2011

We have an ASP.NET application that queues some of its long-running operations (generating reports, for example) into the ThreadPool using System.Threading.ThreadPool.QueueUserWorkItem.

We run the ASP.Net application pool using a specific domain service account so that it can access remote resources, including files and databases. When the execution starts in the ThreadPool, the user identity of the thread is set to Network Service, which doesn't allow us to access the remote resources.The web application can be accessed by users in different countries simultaneously and the format of the data that we provide to each user is based on their culture settings (using the standard globalization settings in web.config). When the queued thread is started, it has also lost this information and reverts to the default culture for the operating system.

Now, we can probably get around most of these issues by capturing the current user identity and culture in a state object and passing that to the background worker, then impersonate the user and set the culture on the thread, but this seems like a very "unclean" way to resolve this issue.[code]...

View 2 Replies

Retain Field Values On Error In A Dynamic Gridview?

Jun 7, 2011

I have a page which has a GridView on it, which is populated from a database. Some of the columns in the GridView have text boxes, as well as Checkboxes.When the user saves the page, the page may error if they have not entered their data correctly. At this point, I need to re-display what they have entered already so they can simply make the correction instead of having to change everything from scratch again.

View 1 Replies

Retain Row Attributes In A DataGridView When User Sorts By A Column?

Oct 20, 2010

I have a DataGridView, bound to a dataset. All the columns are sortable (.ColumnSortMode.Automatic). The user may change data in certain columns, although not the first ("key") column. When data gets changed on a row, I change the backcolor for that row (to show it as dirty). At some point, the user will do something with all of these changes.

My problem is that I still want the user to be able to resort the data by any of those columns. When it's sorted, though, I lose the backcolors that I changed. I do know which rows are dirty, this is just a cosmetic issue. Isn't there a way to retain those backcolors, or any other such row attribute?

View 6 Replies







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