Using Me.close() To Close A Project
Nov 18, 2009i am using me.close() to close a project in vb.net. but by using project is not closing properly. is there any another method to do this?
View 2 Repliesi am using me.close() to close a project in vb.net. but by using project is not closing properly. is there any another method to do this?
View 2 RepliesI am really new to Visual Studio and VB and I am having trouble closing a single form:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Close()
End Sub
When I use Me.close() associated with this button it closes the entire project and not just the single form can anyone.
I'm currently in the process of building a text editor type program, and have run into a brick wall. I haven't done VB in years, so I may just need a little reminder on some things. I have coded everything so far as far as opening files, saving them, changing fonts, colors, etc. However, I'm looking to add a Close button to my menu strip that will just close the currently opened file, and not the entire program, while also ask the user if he/she would like to save before closing the file, and then if they select yes, it will show the save dialog, and if not, it will go ahead and close the currently opened item.
View 2 RepliesI have set up a notify icon for my form. I want to make it so that when the user clicks the close button that it doesn't close the form it just takes it to shows the notify icon. They can exit the program from the notify icon. Can someone tell me how to keep it running?
View 2 RepliesIt seems like whenever i click my close button the application will close but the debugger is still in active.How to exit this debugger? :)
View 2 RepliesIn a program I'm working on, I want a "Loading..." dialog to close when it can't log in to a site using the username and password provided by the user. Basically, I have the code set up right because the function it is supposed to carry out when that occurs does work, but for some reason it ends up in some really weird stuff happening. In the Loading form, I have it set to do "Form1.Show()" and then "Me.Close()", assuming it would simply show the login form and then close the Loading form. However, when this happens, the Loading form closes, and then for only an instant Form1 shows, and then the Loading form shows and Form1 closes. This happens forever until I stop the debugging, and I can't seem to figure out why. Am I using the wrong method? What exactly does Me.Close() do anyways? All I want to do is close the form and open another
View 5 RepliesI have two Close() functions in same class as below:
[Code]...
I am developing a Multi-Project solution (A, B) in Visual Studio 2008.
I need to run a second project from the start up one and then the first project should be closed.
The matter is that I want to Exit the A.exe and kill the process and the dll that are depending on it. And then Run the B.exe.
sometimes, when I use Form.close() when debugging my program, although the form is closed, the application is still running. I noticed this behaviour when using the msgbox function.
View 3 Replieshow to use windows calculator in vb.net 2008?
use System.Diagnostic.Process.Start(calc)
its working but i want when application close it also close this calculator how?
my web browser is my main form and it has a number of sub forms , how can i set it that when i close the main form my sub forms dont close ?
At the moment when i close the main form all the forms close
I have a situation where me.close() doesn't close the form. I have a form with a button with the code seen below. What happens when the button is clicked is the new form shows, but the original form(calling form) is still there. When I go into debug mode, I can see the me.close() execute, but nothing happens (calling form stays open). When I close the second form both forms close. If I comment out the call for the second form to open the first form closes without problem.
Private Sub cmdNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdNext.Click
Dim f As New frmOrder3
[Code].....
i have a small sample seral comms sample project and its working great .however i want it to run such that it will run continually 24 hours a day and not stop. I do not want any unauthorised persons to close the system, or stop it in any way.
View 4 Repliesi have a small sample seral comms sample project and its working great .however i want it to run such that it will run continually 24 hours a day and not stop. I do not want any unauthorised persons to close the system, or stop it in any way
View 2 RepliesMy end result is that I want to launch another setup project after the first setup project closes. The problem is that since setup.exe is just a wrapper for the msi package.WaitForExit is quitting when the setup.exe is finished and not foo.msi.
Using Process As New System.Diagnostics.Process
Process.StartInfo.FileName = "setup.exe"
Process.StartInfo.WindowStyle = ProcessWindowStyle.Normal
[code].....
How to comment and uncomment codes at multiple place within my project at the same time?I am using VS 2010 trial version to develop a VB application.Some of functions only should be showed to developer, not to users. So I must comment them and uncomment them many times during the process of development. please note that those codes are located in many locations and many VB files within my project.
Can I do this in a conveninent way, just clicking a button, or just defining a const or "#define something", something like that?
I am using Visual Studio 2010..I have multiple forms and when I hit close button(red X, top-right) from any form, i want the project to close entirely.Now when I do this, this does not happen by default. I always have to click on the 'stop' button in VS for it to close.
View 6 RepliesI have a main form that has a button with which a smaller form is shown. Think of the smaller form as the Find/Replace dialog in many applications, such as Notepad. It's important that the form is (what I believe is called) modal. What I mean is that it always stays on top of the main form. I ensure that by calling the Show method with "Me" as the owner argument. Whenever the small form loses focus it will not disappear into the background but stay visible (albeit out of focus). If you don't understand open up Notepad and have a look at the behavior of the Find/Replace dialog.
Here's my problem: instead of actually closing the form when the X is pressed, I want it to simply Hide itself, so its position and the state of any controls (checkboxes etc) is preserved automatically.To achieve this I simply cancel the FormClosing event and Hide it:
vb.net
Private Sub Form2_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
[code]....
To show the form, I use the following (note the (Me) to make the main form the owner of the form; this ensures that it remains visible even when it is out of focus):
vb.net
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form2.Show(Me)
End Sub
Now. When I run my project, and open the Form2 (small form), then hide it again (by 'closing' it), I can no longer close the main form (Form1)! It seems the main form cannot close when the small form still exists (albeit invisible)...?? When I don't use the Me argument in the Show method, I don't get the behavior I want. I know I can set the TopMost property to True but that will also cause it to become visible on top of all the other forms, even windows not part of my application.
In vb dot net, Windows form details should save if I press enter key should save and close and escape key should close without save
Currently it happens on onclick event of a button of Save and Cancel, but I wish the keyboard events also work
The form is an About Us form so has nothing on it only a text box and a OK button.
[Code]...
Why won't the button close the form? I'm puzzled, I tried another button just in case with the same result. UPDATE: I set a break point on Me.Close() and it isn't reaching it when I click the button, I created a new button and the same thing happened.
I try to transfer a vb6 application to vb2010. In the vb6 I start with a login panel that the user enter uid and password autenticate with the DBServer if ok show application main menu and close the login form. the order of the me.close() after the mainform.show() does not change, The application ends.
View 5 RepliesHow can i close all forms I use wpf vb 2010 To load other form i use like Private frm As MainWindow = New MainWindow to open the window i used frm.Show()and to close it i use frm.Close()Now I have two forms like form1 and form2 I want to open form2 when i click on the button - ok it's easy The Question How can i closed form1 from form2 when i open form2 using button when i user Private frm As form1 = New form1 frm.Close() It like a cricle and can't closed
View 2 RepliesI'm working with VB.net.I'm having problems while I connect my application to my database today so I wanted to add an error handling to close the form.The problem is that when I put Me.close in a form, this form still open. I used the Form.Closing event handler to verify that it was called, and then ran my application in step by step which showed that the event handler was called, but the application continues and the errors appears to the user.how to close a form properly without closing the application?
View 3 RepliesSimple question but I can't seem to find the answer - can someone tell me which event causes the splash screen to be closed.
I thought it would be either the startupform.Activated or some application level event but I can't find it.
The reason for the question is that I want to control when the splash screen is closed myself - can I do this?
How do i do this in wpf
VB.NET
Private Sub FrmSettings_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
e.Cancel = (e.CloseReason = Forms.CloseReason.UserClosing)
[code]....
as wpf's Close event just gives me e.Cancel and no closereason?
I wrote service with vb.net. I have a little problem. My service is run the another program. It is ok. But that second program is doesn't close. Stay running in task.
[code]..
I have created a windows service that update a database(FOXPRO->MYSQL) every one hour. I fill the database from foxpro into a dataset and then write an xml file then load it to mysql database. It is a success every start of a service, the problem is every next run I am receiving an error --> The process cannot access the file 'D:\CivilStatus.xml' because it is being used by another process. To resolve this problem I stop the service and then restart again manually. What I want is the service will automatically run every an hour without restarting it manually. Here is the part of my code:
Dim XMLFilePath As String = "D:\CivilStatus.xml" 'Path of my xml document
If File.Exists(XMLFilePath) Then
My.Computer.FileSystem.DeleteFile("D:\CivilStatus.xml")
[code]....
Is it possible to close a program when another program close, For instance....Say I have program A and B....I want program B to be close when close or exit program A...
View 12 RepliesHow can one close the usb port (shut off power (electric current)) ?
View 8 RepliesThe database application starts from the login form, and if the username and then password are correct, the main form with buttons for other forms opens.One of the buttons is logoff button, which should closes/unloads all the forms open at that time and then opens the login form.[code]...
View 4 Replies