i'm using exit sub when a certain condition does not meet. but the problem is that the form closes. it should not close the form, instead, it should only exit from a click event. I'm using VB2008Express Edition and MS Access at the back end.[code]
When the user clicks the Exit button it closes the forms and if there was an open file it asks the user is they would like to save. But after the application closes there is still memory being held in Processes by the application. However, when pressing the [X] in the top of the form the application closes again but in this instance it is not held in Processes. How do I write the close for Exit to take into account how the [X] works and close the application cleanly?
Friend Sub CloseAllForms() CloseHelpForm(True) CloseDiagForm()[code].....
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?
I have been making a webbrowser for a while now, everything works well, except i am unable to make the 'open in a new window' button work right. So far i have managed to get a new instance of my form to open with the right url, but i am unable to keep that new form open when the orginal parent form closes.
Code:
Private Sub WebBrowser1_NewWindow(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles WebBrowser1.NewWindow e.Cancel = True Dim Href As String
I have one form which stays open, and lots of other forms which can are opened and closed regularly how can i detect that a form has closed on the main form?
I´m new here, so excuse me if this is the wrong area. I've already read about this in this forum, but it didn´t kill my doubts. I have an form, called AddInstrPadr, wich is created by the MdiParent:
When opening a button and opening a new form as soon as it opens it close for some reason but its not giving any errors as to why its doing this now I've checked the linked linking it to the next form that's fine.
Private Sub PrintPerscription_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Login.con.Open() sql = "SELECT Patient.* FROM Patient where Patient.Wardno = " & Login.WardNo.ToString da = New OleDb.OleDbDataAdapter(sql, Login.con) noOfRows = da.Fill(dsPatient, "Patient") [Code] .....
I have the following code so the user must confirm cancel action, however the form closes on both yes/no action.why the form does not remain active when the result = no?
Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click Dim resultDialogue As System.Windows.Forms.DialogResult resultDialogue = MessageBox.Show(
"Do you want to cancel the Add Worker function?", "Confirm Cancel", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If resultDialogue = Windows.Forms.DialogResult.Yes Then
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?
Basically, I have developed one form which is generic and display different views. On that form I have used Close button. Alphabet E is short-cut for closing the form (i.e. mnemonic functionality).During execution of the form, when I press "E" on that form, my form closes automatically. As per my understanding mnemonic works with Alt control only. I am not sure if I am missing any properties that should be set so that this problem is resolved.
So I've got a somewhat common problem from what I can tell from the search results..I developed a program, got a beta version performing well, noticed a few small bugs, fixed the (all code-related) bugs, and now the program will open and then close immediately. I believe I have determined that the problem is not code related as I have commented outall of the code and it still refuses to stay open until I tell it otherwise. From heaforementioned search results many people have found this to be due to a ensingtonproduct, however I do not own such a product nor do I have any Kensington softwa
I've got some troubles with the socket multithreading, basically the form closes without returning any exception and if I run my application after the compilation it just gives me an error about a yet disposed object (read the code for more information)
I'm quite sure I'm mistaking something in the EndReceive method, anyway that's the resource I've looked into: [URL]..I can't figure out why I should use a state object which contains a socket (or tcpclient etc..) variable instead of some public variables in my current socket class.
I have 2 forms right now Form1 and Form2 the default setting start up is Form2. Inside Form 2 there was a button that will release the Form1 button using Form1.Show().[code]...
On each of my form I have put an 'Exit' button. When user clicks it, another form is displayed (I don't want to use 'MessageBox') asking user whether he really wants to quit. If user clicks yes the form closes. If user clicks no, form is redisplayed.
However, out of 4 forms only one form refuses to redisplay. The code is exactly same on all forms. I have included 2 Express 2008 projects showing one form each in the zip file apps-ssk.zip
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
We have a window that has a text box on it that the user must enter in valid data before going on. So we have put in a message box letting the user know that they have to enter in the correct data before going on in the Leave event. That works just fine, but when the user press ALT+F4, or presses the X in the upper right corner of the window it still goes through the event. We would not like for that to happen. When we were using VB6 the same code was in the lost focus, and when the user pressed ALT+F4, and the X the LostFocus event did not fire, or acted like it did not fire. We have also tried moving the code to the Validating event, but it behaives similar to the Leave event? how to close a window, and either have the Leave, LostFocus, and Validating events not fire when the user Presses ALT+F4, or the X
I have a problem about shown event. I have a login form and a main form. I start the program with main form. then I used frmMain.Shown() to control the login form. When main form is shown, it checks Win. Registry if username and password is stored there. Ä°f yes, login form comes and wants me to sign in and if not, it calls first login form to create a record in Registry.The problem is that; When I click on X (close) button, it closes the login form, but Main form is still running and I can use it without sign in. How do I solve this problem? Or is there any other way to controls if Registry has the record or not
I have to make a modal form for my main form, so I used frmCompany.showDialog(me) method.This frmCompany shows a msgbox to ask if user has to continue without entering the phone. User may press yes to proceed with saving the record or no to get back to the form. But if no is pressed frmCompany closes along with the msgbox.
ElseIf tbPhone.Text = "" Then DialogResult = MsgBox("Phone not entered. Continue?", MsgBoxStyle.YesNo, "Warning") If DialogResult = MsgBoxResult.No Then[code].....
I have this code . This works fine but I am not sure how I can save the changes of the color so when I reopen the form the color is what was picked before it was closed. [code]...
I have a piece of code connecting to my database retrieving data. I was just testing the form on another computer and everytime it loads this specific form it closes the form.You can see the lines I had to comment out in order for the form to NOT close on load. Is there something possibly that needs to be installed on this other computer? running XP pro 32 bit.
Dim conn As OleDbConnection Dim comm As OleDbCommand Dim dr As OleDbDataReader Dim connectionString As String
My form closes whenever I insert an object that has a data bound in it. The object I'm trying to insert is a textbox from the data source window (drag n drop). I've checked on the database and that the table has records in it.
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.
I have a small script that logs all of the website I visit and then displays them on a form. When I open the form the first time it displays all of the websites like it should. However, the second time I open it, it displays two of every website. The third time opening it, three of every website. I think that it is because the data doesn't get erased from the listbox when I close the form. Is there a way to clear the listbox when the form closes or do I need to find a new way to set it up?