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


ADVERTISEMENT

Persist Program Parameter And Variable Settings From One Run Of The Program To The Next?

Aug 2, 2009

I want to hear some discussion regarding what is the best way to persist program parameter and variable settings from one run of the program to the next. I used to often use the ubiquitous INI type file in VB6 programs but I am aware that these are not formally supported in .Net programs. I also have a major aversion to adding to the already overwhelming bloat of the Windows registry by using that to store values.

[Code]...

View 6 Replies

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

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

Program Closes After Msgbox?

Aug 5, 2009

After the OK button is clicked on any message box in my program it automatically quits. Does anyone know how to fix this?

View 3 Replies

Call Event When Program Closes?

Jul 2, 2011

I'm looking for a more elegant way to work around a problem I have

Code:
Private Sub MnuCheckForUpdates_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MnuCheckForUpdates.Click
Dim startInfo As New ProcessStartInfo(mStartUpPath & "" & "Updater.exe")
Process.Start(startInfo)
End Sub

As you can see I�m calling my updater program, but I want some code to run only after the Updater has closed.My work around was to:

A - Initially load the updater.
B � Start a time
C � Check if the updater is still running.
D � If its not call the routine in the timer event.

But this is not elegant is there another way around this, I can call events in the updater but I don�t think I can join them in someway to ProcessStartInfo Class .

View 2 Replies

Program Closes But Still Runs In Processes?

Apr 8, 2011

I have made a program that has an intro screen, moving onto an activity select screen which acts as the main interface to get around the program. After creating the program and installing it on my computer, when I close the program from the activity select screen, using the "X" at the top right corner, the program continues to run under "processes" in the task manager.If I close the program from the intro screen though, it will close everything, including the processes. Is there anyway I can get the same to happen with the game select screen? I can make it work by putting my own "End" button on the form, but id prefer to be able to do it with forms own close button.

View 5 Replies

Remembering Settings When Program Closes?

Apr 4, 2011

I'm working on program that has two forms. The main form is called 'frmMain'. Second form is called 'FrmHistory'. In the History form, you can check a number of combo boxes to set settings for a grid.

This works.Now, when I close the FrmHistory form and then open it again, I have it so those combo boxes (Settings) are how I left them. This works. I do so via this.

[Code]...

View 3 Replies

Set Program To Invisible And Close It When It App Closes?

Oct 31, 2009

i have a third party software and i would like it to lunch when someone runs my program (and no its not a virus). But the thing is when you run it; it shows up in the system tray, how can i set the program to invisible and close it when it my app closes?

View 13 Replies

Exe Closes System.IO.StreamReader Kills Program?

Apr 24, 2011

Ok, So I am making a front-end for a program, and it runs the exe with command line arguments. One of those arguments is creating a log file that tells me who the winner is. Currently I have code that runs the app, tell VB when it exits and then does another event. When testing with message box as the other event, works fine.

When running the System.IO.Streamreader the app just closes down on its own and there are no errors shown.

[Code]...

View 9 Replies

Executing A Piece Of Code Before The Program Closes?

May 18, 2009

Having read the rules I don't have much code to show apart from these lines I want to have executed just before the program or a form closes.

If My.Computer.FileSystem.FileExists("File.file") then
My.Computer.FileSystem.DeleteFile("File.file")
End if

View 2 Replies

NotifyIcon Stays On Taskbar When App Closes In Program

Dec 6, 2009

NotifyIcon stays on taskbar when application closed, then when I move mouseover it, it disappears.[code]...

View 1 Replies

Possible To Make Program 'self-destruct' (delete Itself) When It Closes?

Sep 30, 2010

Does anybody know if it's possible to make your program 'self-destruct' (delete itself) when it closes? I know this sounds like malware, but it's not. What happens is the user clicks 'install', the application copies itself to another directory, then the application starts the new copied file, with an argument that begins the installation, kills itself, and then the copied application restarts and then it's done. But I can't get rid of the original executable.

View 13 Replies

Program Closes But Process Remain Opened?

Feb 9, 2012

For some reason, every time I hit the red "X" button to close the program. The program closes, but the process is still there. How do I make it so that if I press it, itll end the process too?

View 6 Replies

Save To NotePad - Can Be Retrieved After A Program Closes

Mar 4, 2010

how you would go about saving information(username, password, security questions) in a notepad, so it can be retrieved after a program closes. i'm making a log in program in my class, but we haven't done this, so when the program closes, everything is gone. rather annoying, to have to make a accounts each time i'm testing it.

View 6 Replies

Storing Usernames And Password After The Program Closes?

Feb 6, 2012

storing usernames and password after the program closes. I do not want them to be stored in a .txt file, as this is insecure. How do I store it?

View 2 Replies

Make A Simple Program That Detects If A Game Closes?

Feb 10, 2011

I'm trying to make a simple program that detects if a game closes, and when it does, it shuts down the computer.

View 1 Replies

Make The PDF File Be Immediately Released When Program Closes?

Feb 19, 2010

I have a VB program that displays a PDF file. When the program is closed it takes 30 seconds or so before AcroRd32 process releases the PDF file. In certain circumstances if the program is restarted with in this period, the PDF file does not display. The specific circumstances is that I have a second program (re)starting the program that displays the PDF file.

a) Make the PDF file be immediately released when my program closes

b) When the PDF file is loaded test that it properly loaded so that it can be reloaded if necessary.

View 1 Replies

VS2008 / .Net3.5: Program Crashes When Form Closes?

Feb 19, 2010

I have 2 modules and 2 forms. In the module1, I initiated the form classes and also here I have my public appexit() method.In module2, I have another class(in the form of a keyboard done by code). Form2 use this class as its control.I have:

form1_closing()
mybase.close()
)

[code]....

Now when I call appexit() in my module1 from form1, I can see that the debug is going into form1_closing but when it goes inside form2_closing, it crashing the application here.I am developing mobile device application in Vs2008.Net3.5.

View 4 Replies

Setting Background Both At Design Time And Then Runtime - Program Just Closes

Aug 13, 2011

I'm using .net 2008 Trying to create a small graphic component, I have a problem setting background both at design time and then runtime. I derived a panel like this

[code]...

But it isn't working! If I don't Overrides Property BackColor, this is working as expected but I really need to group in my custom tab.

View 6 Replies

VS 2008 : Make A Program For School That Closes The Active Window?

May 30, 2010

I need to make a program for school that closes the active window. My application does now SendKeys.Send("%{F4}"). It works but, it also does it when there are no active windows. I want it to close only the active windows.

View 6 Replies

Program Function - Says, "The Type For Variable [variable] Will Not Be Inferred Because It Is Bound To A Field

May 18, 2012

Public Class Form1
Dim x, c, number(0 To 19) As Integer
Dim s As Integer

[CODE]...

The variables in the brackets [example] do not actually have brackets in them in the original code. These are where the issues are. For both variables, it says, "The type for variable [variable] will not be inferred because it is bound to a field in an enclosing scope. Either change the name of [variable], or use the fully qualified name (for example, 'Me.[variable]' or 'MyBase.[variable]')." Now, I'm not entirely sure if this is a stupid question or not, as I'm used to VB '98 because that's what we use in my programming class at High School. let me know why this won't work.

-Note: The intention of this program is to continually loop the generation of numbers for this list until I tell it to stop. Button1 ends the program, Button2 generates the list one time only, Button3 is supposed to loop the generation of the list, and Button4 is supposed to end the loop, but not the program.

View 9 Replies

Sql Server - .net Program Dataadapter Connection Closes After Fill But Database Still Shows Connection?

Aug 19, 2010

After running the following sub (VS debugger), I try to detach the database in SSMS, but it shows the connection open still and won't let me detach. If I close program in debugger, the database shows no connections. I check the dataadapter's connection in the finally block and is shows closed. What gives

Private Function ClientMasterDBFiles(ByVal MasterClientDBConnection As String, ByVal DBName As String) As DataTable

[Code]...

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

Persist The Datagridview Changes?

Mar 1, 2011

I have a datagridview in a form that is dynamically bound to a datatable. When the user clicks a button I update certian columns of the current row with code like this:

Dim i As Integer = myDataGridView.CurrentRow.Index
Me.myDataGridView.Item("closed", i).Value = DBNull.Value

View 4 Replies

Adding The Withevents Variable?

Jul 11, 2011

i have the folowing co

For x = 0 To 7 Step 1
For i = 0 To 7 Step 1
Dim rectangleShape1 As New Microsoft.VisualBasic.PowerPacks.RectangleShape() 'create a new object to assign to the array location
board(x, i) = New Microsoft.VisualBasic.PowerPacks.RectangleShape() 'create the new object in the array

[code].....

View 2 Replies

A Boolean Value Does Not Persist After Publishing

May 1, 2009

I'm working with Visual Basic 2008 Express. My application opens with the Terms screen, a form that asks the user to declare his acceptance of certain terms and conditions or to decline. If he accepts, the app opens the main screen, giving him access to all the app's facilities. If he declines, the app gives him a message and then closes. Whether he chooses to accept or decline, the app puts his decision in My.Settings so that it can be used next time the app is opened. In this way he is presented with the Terms screen on the next opening if he declined on the last run. But if he accepted on the last run, he is presented with the main screen on his next opening.

All works fine when I do a debug run. But when I build and publish the app onto my desktop it opens with the Main screen instead of the Terms screen.

why it works on F5 but not after publishing?

Public
Class frmTerms
Dim Accept As Boolean

[Code].....

View 11 Replies

Can Datasets Persist In VS 2008

Sep 4, 2009

I need to very quickly write an exe system on a laptop where when the laptops are connected to the network they read a database table and store the data locally, so staff can use the laptop while they roam.The laptops have quite small capacity and the company would prefer not to use SQL Express or Access.

My question is, can the data initially be downloaded into the exe application via a dataadapter and dataset, and will that dataset the retain the downloaded data, or will I need to ensure the dataset is written to an XML file and then loaded/unloaded each time the laptop application is started while the staff are travelling ?

View 2 Replies

IDE :: Windows Service - How To Persist A Value

Jun 6, 2012

I am a web developer who now has to change a Windows service. I never worked on a Windows service before. I have a several programs that can run within this service. I want to persist a value of a variable from program to program.

View 1 Replies

Viewstate Does Not Persist After Postback

Mar 21, 2012

I'm having some problems in persisting the viewstate on postback for a Control (vb.net)

here's some code i've put in my control[code]...

I'm setting EnableViewState = "true" everywhere i can, but still no result. Do i really need to set those properties here. (ViewStateMode and EnableViewState) If not, where should i handle this and what is the difference between those properties?

View 4 Replies







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