Close Only The Main Form In 2010 Without Terminating The Application?

May 7, 2011

I have a login form which I need to close without the entire application being terminated. I tried using Me.Close() , Me.Hide() as well. The login form is used as the main form as well.

View 2 Replies


ADVERTISEMENT

VS 2010 Sub/Child Form Close When Click On Main/Parent Form?

Jun 5, 2012

i am having some trouble in my Windows form application. i have 2 forms1st Main / Parent Form2nd Sub / Child Form (Menu)

View 7 Replies

Terminating A Windows Form Application?

Dec 18, 2009

What is the proper way to terminate a Windows Form application while it is just executing in the MyApplication_Startup routine?I have an application that looks for a database file upon startup. If it does not find it I prompt the user and ask if they wish to locate the file or not. If they choose not to locate the file I want to just terminate the application. Currently i just execute the "End" statement, but that does not seem like the proper way to terminate a program.

View 2 Replies

VS 2008 : Modal Form Hide Instead Of Close - Main Form Does Not Close

Mar 20, 2009

I 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.

View 8 Replies

VS 2008 When Close The Main Form All The Forms Close?

Aug 30, 2009

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

View 2 Replies

Close Another Application When The Main Process Has Been Killed?

May 3, 2011

I have a vb application(1) which is made to launch another software(2) with specified parameters, but i wanna keep my application opened as long as the 2nd one is opened too, and I also want to close the second one automatically if mine has been force closed by the user in windows taskmanager, on the desktop, or in any way.

So I need something which detects if windows is closing the program and kill the second application auto.

I would like to avoid the task manager block, because that isn't necessary for this i guess.

View 7 Replies

How To Close Main Form

Feb 23, 2009

I can't seem to get the right code to close the main form

View 3 Replies

How To Close External Application On Exit From Main Screen

Oct 14, 2009

I have a button in Main screen, which calls A.exe when you pressed on it.
Process.Start("A.exe").
If I exit from Main, how can I make sure A.exe is closed too? Application.Exit in Main doesnt seems to work.

View 2 Replies

Display The Main Form And Close The Login Form?

Sep 2, 2011

VS2010 VB.NET windows form app I have a login form that is my startup form.when uer hits OK I display the main form and close the login form, like this:

PrivateSub OKButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OKButton.Click
frmMain.Show()Me.Close()EndSub Problem is the application closes with me.close. Why? How can I close only the login form and leave the main form urnning???

View 3 Replies

.net - Disable The Close Button Of The Main Form?

May 30, 2011

Is there a possible way in VB.NET to disable the close button of the main form as I've seen in many installer! I don't want to hide it, I want to completely disable it!

View 3 Replies

Close Login And Open Main Window Form?

Feb 15, 2012

I am having a difficulty in this login form that I have made. The same as the premade template login in VB 2008 which I am using right now.Here's what happens when I run the program Log in form open > Log in successful > Main window appears *The login form still does not disappear.

I tried hiding it via me.hide() Log in form open > log in successful > Main window appears > log in form disappear.*Now the problem is that I cant close the whole application because the login form is still there only hidden. Again I tried putting in the "EXIT" button the code me.close() login.close()Log in form open > log in successful > Main window appears > log in form disappears > Exit application *Now everything seems to be ok now and then I found another problem.Instead of clicking the exit button I tried clicking the X button on the main window. There I found out that it only closes the main window. Therefore not closing the whole application because the login form is still hidden.

View 2 Replies

Stackoverflow Exception Thrown When Calling Me.close() On Main Form

Apr 3, 2009

I have done some reading and it seems that this error comes from recursive calls but I have not done anything in my form_closing handler except for call me.close, that's it.

So I don't understand how this exception has entered my project. All of my data and functionality is still working as I expect. It just seems to throw this exception when I try and exit my project.

what I could check to prevent something like this from happening?

View 3 Replies

.NET End Vs Form.Close() Vs Application.Exit Cleaner Way To Close One's App?

Feb 12, 2011

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 Replies

Vb2010 Close Of The First Form Close The Application Even If A Second Form?

Feb 14, 2011

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 Replies

Terminate - Terminating An Application Programmatically Using A File Path

Sep 9, 2009

I want to terminate an application using the full file path via vb.net, yet I could not find it under Process. I was hoping for an easy Process.Stop(filepath), like with Process.Start,

View 2 Replies

Forms :: VB - MDI - Application That Consists Of Mainly One Main Form - Ranging Form Graphs, Tables, Dropdown Boxes, Print Preview

Apr 7, 2010

I have to write an application that consists of mainly one main form, but several different things I wanna display. Pretty standard I guess. So there is a menu, some controls, and the main stuff below (ranging form graphs, tables, dropdown boxes, print preview, etc). I would like to use it like one would use frames in html, design an object that is limited to a box or panel that I define. The literature I have does not give me a clear idea of how to do this (yet). The most obvious seem to be the use of MDI, open a predefined form with no borders, maximize it before showing and remove all minimize/maximize options. But that does not work so well. The form inside the MDI parent does not fit the size that is given for it when it is loaded. e.g.

[CODE]:......................

So my main question is: Is MDI the way to go here at all or are there better/easyer ways to achieve this? If MDI is the way to go, how do I sucessfully restrict a child form inside another object, without giving the user any opportunity to resize (i noticed that I have minnimize/maximize/close buttons, even if I disable them on the child forms themselves)

View 6 Replies

Use Main Form Like MDI Parent Form In Window Application?

Sep 10, 2010

how can I use main form like MDI parent form in window application?

View 1 Replies

Application Start And Main Form?

Oct 2, 2009

I am developing a commercial application that needs to do some environment checking upon start up. I need to check things like the following. 1. Is there a registry entry on this machine that has various keys for paths to SQL Server 2. If it does not I need to create them. 3. Prompt user for the path to the SQL Server 4.Check the SQL Server to see if the database I need exists. 5. Create the DB if not. 6. Populate the DB with the tables I need 7. Create stored procs in the DB 8. Write the registry. I could do all this in the form load of the main form. However is there a better way? Like doing all these checks as part of a splash screen for example.

View 2 Replies

Application That Contains A MDI Form As Main Screen

Feb 25, 2009

I have an application that contains a MDI Form as the main screen. In the text field of the form, I am trying to display the version of the application using the following syntax:[code]Using the above code, it always looks like 1.0.0.0 when in reality I'm on version 1.0.0.6. What am I doing wrong?

View 11 Replies

Reload The Main Form Without Closing An Application?

Jun 12, 2009

I need to reload the form of my application. The application has only one form vb.net 2005. I need a button that will call the page_load event so I can restart and reload all my settings. basically I need to call the Sub private Page_load event().I just need to force the reloading of the form without having to close it and reopen it.This is the code which I need to reload:

Public Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
For Each URLname As String In My.Settings.URLtoTrackCollection
URLtoTrack.Add(URLname)

[code]....

View 8 Replies

Display Application Name In The Text Property Of Main Form?

Feb 25, 2012

I am wanting to display my Application name in the text property of my main form. This is the code I a using:
Me.text = My.Application.Info.Title & " " & My.Application.Info.Version.ToString I am wanting to change the name of my project from when I first created it and for this new name to be displayed via the above code.

I have changed the name under the properties setting, yet it is not updating.

View 2 Replies

Pass Constructor Arguments To Application Main Form?

Oct 23, 2010

I've constructed a custom System.Windows.Forms.Form that requires arguments to New. I want to use one of these as the MainForm in a Windows Forms Application. How do I get the Application Framework to pass those arguments as needed?

View 1 Replies

VS 2010 - Process Exe Thread Is Halting Main Application?

Feb 10, 2012

I have two applications. For performing certain functions, i run a second exe, via a process, and wait till it is complete (exited) to continue with my main application. I run through many repetitive functions on different files.Everything runs fine however, when i am doing a run and it is on the x loop number, the main application seems to halt the secondary process exe. I can only assume this is what is happening as, if i close/stop (not pause) my main application in VB, the second exe continues from where it was halted until it completes.

View 4 Replies

VS 2010 Noobie: Make The Main Window For An Application?

Feb 17, 2012

I'm a noobie coming from VBA. i thought i'd try my hand in VB (because this stuff is fun). I'm trying to make the main window for an application. i've created 2 forms so far. one entitled "Main" and the other "Form1". I would like for "Main" to be the main window of the application.

View 2 Replies

Minimizing A Modal Form Minimizes Parent Or Main Application?

Jun 2, 2009

Is it possible to have an application where form1 opens a second modal form (form2) and then allows the user to minimized form2 causing the entire application to minimize to the taskbar.(form2 is never shown in the taskbar) A simple example of this is winzip where a second modal progress window is opened which can be minimized?

View 10 Replies

Using 'Application.Designer.vb' To Set One Of Two Forms As Main-form For Splash Screen

May 25, 2009

I am using the following code in the 'Application.Designer.vb' to set one of the two forms as the the mainform for my splash screen.The global string array gSetupStr(0,1) only produces a correct result when any Msgbox is inserted before the 'If' statement.However,I do not want the Msgbox during a splash screen, but do want to control the mainform. [code]

View 1 Replies

VS 2010 Main Form Focus?

Feb 22, 2012

I have an application that just stores shortcuts to most used applications on users desktops. My problem is that when the machine loads after they login the app window looses focus and sometimes doesn't show in the taskbar. I tried to use Me.Focus() but that just gives the treeview focus and not the form itself. I mean the parent has focus in the treeview but the form is not highlighted, I can then click on the form and it gets selected.

What is a good way to get the whole form focus? I used me.focus in the form load too.

View 8 Replies

VS 2010 Can't Seem To Get A Reference To Main Form From Sub Form

Jan 28, 2012

My app has a main form (it's the startup form). It includes a number of menu items which typically open modal sub forms. However there are 2 menu items which just need to open an Outlook Explorer calendar for the user to manipulate appointments. My VB6 version used hidden sub forms to do this and handle the subsequent interaction between the user and the Outlook objects in the Calendar. I need to stop the user interacting with the main form while the Outlook Explorer is open, ie as if the Explorer window were a modal sub-form to the main form. So I manually disable the main form while the Outlook activity is going on, then (try to) enable it when the user closes the Outlook Explorer window. Problem is I can't seem to get a reference to the main form from the sub form to do this, nor pick up an event in the main form which I could use to trigger the enabling of the main form.An alternative might be to delete the hidden sub forms & put all the code in the main form, but this would be quite ugly; I think I would need to maintain two parallel sets of Outlook objects at the top level in the main form for each of the two functions (a number of the Outlook objects are declared With Events). I would have to have for example mobjOutlookExplorerFunction1 and mobjOutlookExplorerFunction2.

View 5 Replies

VS 2010 Splash Screen & Main Form?

May 11, 2011

Namespace My
Partial Friend Class MyApplication
Protected Overrides Function OnInitialize(

[code].....

View 5 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







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