Can't Put Deletion In Form Closing Because Program Is Still Running
Apr 14, 2009
I'm lending a copy of my .exe on a memory stick and because I dont completely trust them, , I would like to build in a function that as soon as my app has finished doing what its doing And the big red X is hit it will delete itself, but my problem is that i cant put the deletetion in the form closing because the prog is still running, so what should I do? Is there a way that I can get the app to close as soon as the dedicated task is complete, It will remove itself from the memory stick but if the X is hit before the process is complete the then the prog will remain.
View 14 Replies
ADVERTISEMENT
Jan 21, 2010
Stop program closing if a special form is running?
View 8 Replies
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
Oct 10, 2011
have you of any ideas in why does my software in vb 2010 still exist in the task manager (process tab), after i closed the program? i noticed it when i want to delete the .exe file.
View 10 Replies
Sep 6, 2011
I have form1 and form2. A button on Form1 calls a thread background process (below). That process processes the command and when its done should close form2. I'm opening form2 within the current thread but trying to close it in the background thread. This is because if i close it in the current thread it closes immediately. I included the 2 functions below and what I have tried in the inline comments. Form2 is a simple form, basically just an animated gif. It is to show the user that something is happening(like a status bar) then close when its complete. I tried running different priorities instead of different threads but due to the results threading seems to behave the best. I'd like to keep access to both forms during the process, the pc, and screen refreshes realtime.[code]
View 2 Replies
Jan 4, 2012
I'm developing Applications in VB.NET 2008.
I have MDI Parent Form and i'm going load all form as MDI child. Here i'm going to give option to "Close All" toolstripbutton in top of MDI Parent to close All mdi child forms.
Now i would like to check that On click of Close All Toolstripbutton , i have to close all mdi child form but except those form is on process, example, I have opened/Loaded 5 MDI child forms within MDI Parent Form.
Child forms are ( just for example ) ,
1. Customer details Form
2. Item Details Form
3. Import Orders Form
4. Stock Details Form
5. Production Entry Form
Here 3.Import Orders form is importing from Excel with 5000 records and 4. Stock details form exporting to excel.
So now if i click "Close All" button then i have close only Idle form i.e 1,2 and 5 but i should not close 3 and 4 since its on some process.
So Is there any .NET option to check that form in process/idle or do I have to check manually by having any Flags ?
View 1 Replies
Sep 13, 2011
I am trying to close Form1 and then open Form2, but when i do it closes the whole program.I have tried to just hide Form1, but then i can't close the program and I have tried this method too but could not get it to work?
View 2 Replies
Jun 25, 2010
Does anybody know if it is possible to download email messages and send something to the email server to delete an email from the server using ASP.NET?
I have developed a program to download email information from my email server, but I can't figure out how to send something to the server to delete an email. I developed what I have using the resources at this location[url]...
I am sick and tired of all the junk mail I am getting and want to write my own program to delete emails from my email server based on criteria I create.
I have VB 3.0, VS 6.0, VS.NET 2003, VS.NET 2005, VS.NET 2008 and VS.NET 2010 Express. I have developed web sites and standalone programs using VB and ASP.NET. My experience and knowledge is not extensive, but i do have enough knowledge to create a VB program.
View 6 Replies
Jul 16, 2009
I want to make a fairly simple program that would prevent file deletion of certain folders andor files that i would input into the program. Say if someone tried to delete the file it would display an error message.
View 3 Replies
Apr 27, 2011
I have the following code to close a form which is a child. The problem is that when it closes, it closes the MDI parent too.
Private Sub frmTransaction_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
If ListView1.Items.Count >= 1 Then
[Code]....
View 4 Replies
Mar 15, 2012
I have a customer and booking data sets on my form. customer id is a foreign key in booking table .but when i click delete button. it gives me an error: The DELETE statement conflicted with the REFERENCE constraint "FK_Booking_Customer". The conflict occurred in database "photoshoot", table "dbo.Booking", column 'Cust_id'. The statement has been terminated. Its a one to many relation between customer and booking. one customer can make many bookings each booking will belong to only 1 customer.
View 1 Replies
Sep 1, 2010
On my program the user clicks a button which then runs the main code for my program. The problem is once the code is executed I can no longer move or interact with any form boxes, reliably at least . Sometimes there will be a period of delay where I can move it for an instance. Is there anyway I can make it so that my form is able to be moved while the program is running?
View 3 Replies
Jul 26, 2011
I am trying to write up a program that has a few forms that you interact with and do various things with but I also need to have a TCP/IP client/server running in the background to handle a automated connection to a PLC. Is there anyway to have the TCP connection open and receiving/sending in the background even when the operator is doing something else?
View 1 Replies
Jan 26, 2010
Some time ago I saw a code to host an exe from within a visual basic form, acting as its parent. How would I go about doing this in vb.net? I havent programmed in ages, but recently have gotten an interest again in order to complement
View 3 Replies
Nov 29, 2011
I'm using the Microsoft Access Database Engine and trying to do a compact using the following code:
Dim acc As New Dao.DBEngine
Try
acc.CompactDatabase(serverDataPath & "MQRMeta.accdb", serverDataPath & "MQRMeta.001.accdb")
Catch ex As Exception
PrintLog(modName, rtnname, "Error compacting database. " & ex.Message, "MQR2500E:")
End Try
View 2 Replies
Mar 23, 2011
How is it made, controls created in a running application appear again when I reopen it? The images loaded into picturex must be saved in a database?
View 7 Replies
Apr 28, 2011
I have just built a full main menu for my pc game and need to terminate the running program using a button held within the form. I have built a button labeled exit and tried a couple of closing codes such as:
Me.Close
ExitApplication
View 2 Replies
May 5, 2012
is it possible by 1 program to save settings to another program without running the program that is being edited?
View 6 Replies
Feb 8, 2012
Alright, I have a vb6 LEGACY application and new Functionality (Form) written in c#. I have a VB.NET COM Class as a wrapper. I can launch the .NET Form just fine. THe problem I am having is closing the .net form from vb6.
Example:
In VB6, I have something like this:
CODE:
But it does not work becuase frmViewer is Nothing for some reason. how I should close the .NET form that was launched from VB6?
View 8 Replies
Apr 2, 2012
I have a parent form that has a list of items and each item has a unique ID. The user can open one or many of the items in a child form (it is set up in a tabbed MDI), but it can only open one instance of each item at a time.
In the parent form, I was going to make a collection (or something like that, maybe there is a better way) to keep track of which items are open in the child forms. I need to know when each child is closed so that it can be removed from the collection and reopened at a later time. I was thinking that when the child form closes, it somehow does something (like raise an event) that tells the parent form to remove the unique ID from the list of current open child forms.
My questions are, is this a good way to do this and I am pretty sure I would use the form closed event in the child form to update that parent form, but as well, I didn't know if this is the best way of handling it.
If raising the event is a good way, are some examples on how to do it out there? I found some for controls, but not while the form is closing/closed.
View 4 Replies
Jan 20, 2010
I want to prevent my program from running when it is already running.How can I do that in my vb2008 Code?
View 1 Replies
Feb 3, 2010
is there "rules" as to how to close programs writting in vb.net(2008)? I've migrated to dot net from vb6 and have rewritten some of my programs in the new language, but I've discovered a problem, since using the new programs if you try and close the machine down (Windows XP) the pc just hangs until I use the task manager and kill my programs.
View 1 Replies
Jul 6, 2010
How can i prevent from closing a program even with the task maneger?
View 39 Replies
Nov 9, 2011
This is my first VB program, but how do i make the command prompt stay ?
Option Strict Off
Option Explicit On
Module Module1
[code].....
View 3 Replies
Mar 23, 2010
When I close my compiled application, it will always hang for a few seconds before closing. It isn't something to do with my PC, I've got a quad core with 4GB of RAM -[code]...
View 4 Replies
Nov 23, 2011
I am trying to write a code that lets you open a text file and display it in a text box. I need to make it so that when the user tries to close the program it will ask them if they want to save any changes made to it.
View 3 Replies
Apr 28, 2010
I am working on a project that has the user building scrapbook pages through several different forms. When the user selects something a presses a button I have the information about the selection load to a list box which is on a CheckoutForm. One of the options I have is for the user to save what they have made (this includes the information in the list boxes) and return to a previous form to build another page. I have been trying to use the Me.Close() but it does not save the information and using Me.Hide() displays the wrong elements on the forms.
View 5 Replies
Dec 29, 2010
i have a parent form which is having a grid view. In the KeyDown event of the grid view i am calling a child form. If the user closed the child form, my application should close both the parent form and child form. What i have done is, i declared a boolean in the child form and passed the boolean value to parent. May be the code below will give the picture of what i am trying to do.
Private Sub gvJournalEntryDet_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles gvJournalEntryDet.KeyDown
View 8 Replies
Jun 22, 2010
I have a unique challenge that I just cannot seem to get by...I have a form with a series of listboxes that allows the user to rename items in the listbox (I probably should be using a listview control instead). When the user right-clicks and selects rename from the context menu I show a simple form with two labels & text boxes showing the selected list box item in one textbox...the other is blank waiting for the user to enter a new name. What I'd like to do is when the user closes the rename form, the information is passed back to the calling form and a listbox refresh method is fired to show the changed name. Couple question:
First, is there an easier method to implement the renaming concept in a listbox (probably should be using a list view) i.e., have I overcomplicated things?
View 4 Replies
Aug 29, 2011
I have 2 forms. When a user clicks something on form1, form2 pops up. After user is done with form2 and closes it (where the dataset is updated), I want form1 to "reload" the dataset to reflect changes made in form2.
View 1 Replies