Forms :: Detecting Open MDI Childs When MDI Parent Is Closed
Dec 16, 2010
I'm new to VB 2010 but have be using VB6 for many years.I'm currently stuck trying to store the state of open MDI childs at the moment the MDI parent is closed. Clicking the parent upper right close button appears to close all open MDI childs before running the parent 'Closing' or 'Disposed' events.I am therefore unable to detect which MDI childs are open and cannot restore them next time the application is run.Is there any other event for the MDI parent I can detect the start of the closing process before the children are closed?
I have an MDI web browser and it would be handy if it could save the open MDI childs at shut-down so that the next time the user would open the web browser the MDI childs would be still there...
Is that even possible?Private Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
I have a main form, and some sub forms, and each sub form can have some sub forms. When I have multiple sub forms open, and I try to get data from the parent form, it returns the data from the wrong parent form.For example I have two instances of Mainform.subform running. If I do something like this in a child form of one instance of the subform. It returns data from the other subform.
dim l = Mainform.subform.listofdata
Edit:I am using visual Studio 2008. Winforms, form designed using designer. In my mainform I am doing this
Protected Friend frmMain as Mainform frmmain = new mainform
In frmMain I am doing this
Protected Friend frmsub as new Subform' frmsub = new subform
Been searching the web for about an hour now and not having a lot of luck. Got my MDI Parent with some buttons on and one of the buttons I want to hide all open MDI Children forms but I don't want to close them.
I'd take both C# and VB.NET suggestion.I'm using LINQ to query data. I'm trying to query the parent and count the child tags.Here's my Tags table column:
TagId (int primary) TagName ParentId (int Allow NULL referred to TagId column)
Now what I want to do is to detect when the notepad has been closed then I can bring the form back to the front and I just do not know which commands to use for this to detect a program outside of VS 2010.
how to disable parent window while child is open so the user cannot click any object in the parent window and to Force the user to interactive only with the child
I'm making a Visual Basic GUI application to display whether a number of my ports are open for people to know whether things like my website and my Minecraft server are open.My problem is I have absolutely no idea how to do this in Visual Basic.Basically, I'm asking for something which sends a signal to an IP with a specific port, if it is open then return true, if it's closed, return false. Similar to: http:[url]....
Simply enough, I closed a design window, and now I can't reopen it.Whenever I click on the form in the Solution Explorer, there is no option to show the design view, yet I know that there is one.When I go to the folder where the files are stored, there is a file there is supposedly the design of the form I closed, but when I open it, all that appears is another window of code.
I need to know if a form2 is already open when a button1 on form1 is clicked. I found the following code which fails when I open form2 then close form2. When I click button1 on form1 nothing happens. Is there a way to reset form2 to nothing or is this just wrong?
Sub isFormOpen() If xmlTest Is Nothing Then xmlTest.Show() OpenXML(filename) End If End Subdavidbell
and in class that starts new thread started every time users change some data(very often)
[Code]...
1. other parts of application are targeting other SQL server...just this adapter is updating only one row(table has two columns, some id and last time any of users changed something.
This reader is done in the form load event and is the very first thing done so I don't understand why it's telling me there is an open DataReader. I've also set MARS=True in my connection string so obviously it is something else.Here's my code and like I said the routine is called at the top of the form load event. The error occurs on the
I get the following message "There is already an open DataReader associated with this Command which must be closed first." Is the insert statement the most effiecient way to write to the table row by row?
Dim comment As String Dim cnx As Data.SqlClient.SqlConnection = SqlCnx.SourceDB Dim cmd As New Data.SqlClient.SqlCommand("select number,comment from [Comments]", cnx) Dim daComments As New SqlClient.SqlDataAdapter Dim bsComments As New BindingSource cmd.CommandTimeout = "360" cmd.CommandType = CommandType.Text cnx.Open()
I was just wondering - is it possible to detect, with either .net, SilverLight, Flash or some other plugin, whether or not Snipping Tool is open, or detect when the user opens it (after the page has loaded)? Also is it possible to detect when print screen is pressed even if another window is active?
I have been searching and trying for quite some time now but did not yet find the right way to solve my problem.Here is what I want to do:- open powerpoint with a file (an disable the UI of my app while it is opened)- make some changes to this file- save it with a new name- get notice when Powerpoint is closed (either by my app once the automatic changes are done or if the user quits Powerpoint)- enable UI once Powerpoint is closedThe notice is my problem. Is there an easy way (other than timers that check the process list) to get notice of when my started Powerpoint-Process is closed/quit?
I would like to know if its possible to start up a second windows forms inside the parent form. Ex: A button is pressed and a new form is showed. I would like to keep that new form inside the parent form, and have it not be able to go outside the parent form.
I know I can set IsMidContainer in forms for parent-child relationship forms. I just want to know if the parent form could be a panel. If so, how can i do it?
I typically prompt the user to save changes in the FormClosing event in MDI children. The application updater uses a Process.CloseMainWindow call to close the application if it's running before the patch update is applied.
I need to detect when the updater is closing the application and NOT prompt the user to save changes but save them automatically. I've tried using the System.Windows.Forms.CloseReason but this method isn't working for me. I capture the CloseReason in the MDI Parent FormClosing event but it's called AFTER the MDI children are told to close. I tried capturing the CloseReason (e.CloseReason) in the MDI child's FormClosing event but it registers as MDI Parent closing and a normal application exit is also going to raise this same e.CloseReason so I can't auto-save here either.
So my question is: How can I detect this Process.CloseMainWindow being used to close my application so that I can bypass all save prompts and save automatically? What is the first event called in this method of closing so that I can signal all MDI children that are open in their FormClosing event to just save?
On a dynamic form a WebBrowser control connects to a Media Player on one of our servers.After the form is closed the audio is still running even though the FormClosed event is handled.[code]
Basically, I have a program that uses up one Monitor (With maximize/minimize/etc options), and I'm going to develop another window that by default, you'll have to swap to. But, if there are two or more monitors detected, throw the 2nd form on the 2nd monitor.
I have found a way to detect multiple monitors (Using the SystemInformation Class to return the monitor count), but it's placing the form on the other monitor that's the problem.
I need to set a variable upon the user scrolling to the end of the text on the textbox ("Scroll to end to accept terms") type thing but I can't seem to find how to get the value.
I would like MyProcess() to fire when I click on any of several checkboxes. I could do it like this. [code]I have alot of checkboxes, and anyway, this method isn't very scalable.Is there any other way for a form (or panel maybe) to detect mouse events on child controls kind of like the way the KeyPreview property of a form allows it to detect key events of it's child controls?
I have made a project on Library management system using Microsoft Visual Studio 2008 and Sql server 2005 .I have used MDiParent form in this project, from where I can click on the menu item to open the desired form.
I am now able to open the child forms in the main window background.Now what happens is When I click on one menu Item it open in the parent form background.I am able to open all child forms corresponding to the click event in the MenuToolStrip ...all in the Parent form Now the problem is that I cannot minimize child forms when I minimize Parent form..I want child forms also to minimize along with the Parent form.. Also are child forms still not attached to the parent Form is also my question here.....
I'm very beginner in vb. I need to connect two forms with ms access. First form is connect with second using(form2.show). My need is when I execute the coding. I got a error on first form " An error occurred creating the form. See Exception.InnerException for details. The error is: Operation is not allowed when the object is closed.
I have an app that opens and closes several other forms. How can I stop the fade in out of the forms when they are opened/closed in used in Vista/7? It just gets annoying.
I am using a Windows Dialog form in my VB 2008 project. I bring up the dialog form no problem with the following Dim resultNewInc As DialogResult resultNewInc = frmDialog.ShowDialog() If resultNewInc = DialogResult.OK Then ...some code here ... End If
And in the Dialog Form, the OK button has code Me.DialogResult = System.Windows.Forms.DialogResult.OK Me.Close()
But there is one problem. If I call up the dialog form again, the form controls have the text values that were typed in during the previous instantiation and a class which is part of the form was not disposed. So it looks like the form is being "hidden" and not closed. I tried to use the code form.dispose but it didn't work.