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


ADVERTISEMENT

Close Child Form When Click On Parent Form?

Jun 5, 2012

I am having some trouble in my Windows form application. I have 2 forms:

1st Main / Parent Form

2nd Sub / Child Form (Menu)

Problem:

I want to close my 2nd form (which opens on top of 1st form) when I click on the 1st form.

View 3 Replies

Open A MDI Child Form Using A MenuList On The Main MDI Parent Form?

Feb 6, 2011

I have a MDI Parent form created with a MenuList, I also have the MDI child form created.ow do I go about using the MenuList to open the MDI child form within the parent form?

View 1 Replies

How To Close Parent With Child Form

May 16, 2010

I am using Visual Studio 2005. What I am trying to achieve is the following: I have a login form (form1) for the user. On successful login, a new form (form2) pops up which allows the user to add details of a student (name, age, address, courses taken, etc).

Following is what I tried to achieve the above said:
1) File>New>Project>VB Windows Application ................for form1
2) Project>Add Windows Form>Windows Form ...............for form2

What is happening is when I close form2, the application is not getting closed, form1 still exists. What i wish is that when I close any form (form1 or form2 or form3 etc ), the entire application must close.

View 6 Replies

Forms :: Close And Reopen Child Form Within Parent?

Dec 22, 2010

When my application first loads the parent opens and I select my child form from toolstrip:

'In parent open the form when option is clicked
Public Sub Showfrmitemreview(ByVal sender As Object, ByVal e As EventArgs) Handles itemreivewStripMenuItemA.Click, itemreviewStripMenuItemB.Click

[Code]....

Nothing happens I don't even get an error message. I've played around with the code numerous times and the only thing that worked was to have it open outside of the parent which I do not want to happen.

View 1 Replies

Write Text From A Parent Form To The Active Mdi Child Form VB 2010

Jan 28, 2012

It has to be a simple line of code but I do not know how to construct it. Using VB 2010 Express, I have a MDI parent form and many child forms. I want the parent form to determine what child form is active and load data into the RichTextBox1 on the child form. Each Child form has a RichTextBox1. The parent form gets its data by loading a file.

I am close to a solution but just can't get there. You will see in the code below, if I make a direct reference to a specific child form, it works great. What I want to do is to use the Active Form function to determine which form to write to. I have looked at the MS tutorial which gets me close.

Private
Sub OpenToolStripMenuItem_Click(ByVal sender
As System.Object,

[Code].....

View 6 Replies

VS 2010 : Load A Child Form By Default In MDI Parent Form?

Jan 23, 2011

I want to load a child form which is a login form by default when the parent form is loaded.Right now when I click new file on the toolbar of the parent form, then only the login form is loaded but i want it be loaded by default without clicking anything.

View 10 Replies

VS 2010 Child Form Tell Parent Form It Is Closing And Send ID?

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

Unable To Place A Label Box In The MDI Parent Form And Then Open A Child Form The Label Box Highlighted In Child Form?

Dec 15, 2011

I have an issue when I place a label box in the MDI Parent form and then open a child form the label box highlighted in child form?

View 6 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 2010 Parent-Child Form Using DataGrids

Aug 5, 2011

I am trying to create a simple parent-child form in VB2010. I use a datagridview for each table/datasource and each is bound to the parent/child table and each table grid fills correctly. What I want is the parent-child relation to enforce filling the child table with only rows that fulfill the current row on the parent. I have created a DataRelation in the form load, but it will not permit a relation between tables in 2 different datasets. If I attempt to place both tables in a single dataset and define the PK-FK relation in the SQL Server I cannot create 2 separate datagrids from the same dataset.

View 2 Replies

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

Mdi Child Form Order - Move The New Form Behind The Main Form While It Loads

Aug 5, 2010

i have my main child form open. then i show the new form:

[Code]...

but when the form opens it flickers a lot. so i want move the new form behind the main form while it loads so the user does not see the flicker. once it is done loading i will set the form to topmost. how do i move the new form behind the main form?

View 12 Replies

Creating A Parent-Child Window Form In VB 2010?

Aug 4, 2011

I am trying to create a simple parent-child form in VB2010. I use a datagridview for each table/datasource and each is bound to the paretn/child table and each table grid fills correctly. What I want is the parent-child relation to enforce filling the child table with only rows that fulfill the current row on the parent. I have created a DataRelation in the form load, but it will not permit a relation between tables in 2 different datasets. If I attempt to place both tables in a single dataset and define the PK-FK relation in the SQL Serve,r I cannot create 2 separate datagrids from the same dataset.

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

Accessing Datasets Loaded In Main Form From A Child Form?

Aug 11, 2009

I have a program I've been working on for some time now and I'd like to try to streamline it somewhat. I have a main menu form that has a split panel, in the left panel is a treeview that displays forms you can open and when one is selected, it opens in a child window in the right panel. Each time I open form I called DWNForm, it does a series of dataset loads which are the populating items for a series of listviews.

What I would like to do is have these datasets load once during the mainMenu load and then have the DWNForm be able to access the datasets once it is called from the treeview selection.

View 8 Replies

Create An IMAGELIST In A Main Form And Add To It Then Have It Accessible Within A Child Form?

Mar 22, 2011

I want to create an IMAGELIST in a main form and add to it then have it accessible within a child form. I found several MS examples on database shared access but this is NOT the concept I am after. Straight forward:

Child_Form.<function_to_execute_in_child_form>(The_Passed_Imagelist)

So, within the child form it want to do whatever I like to the IMAGELIST! I have tried passing the object by reference and anything I could think of.

View 3 Replies

Forms :: Open A Child Form - Main Form Is Unresponsive?

Apr 20, 2011

When I open my child form,

frm_Analogs.ShowDialog()

It opens up the new form, but now I can not interact with my main form. It will not accept focus or allow me to interact with it.

Do I need to change the form type?

View 4 Replies

MDI Main Form Having Menu Strip And One Maximized Mdi Child Form?

Dec 14, 2009

The problem is that icon on the Child Form appear in front of Menu strip control on MDI form when child form is maximised.

View 2 Replies

2003 Control On Child Form To Create Event On Parent Form?

Oct 28, 2010

Here is the pertinent part of my code:

Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

[code].....

View 3 Replies

Call A Form Load Parent Event From A Child Form?

Jun 3, 2011

I have two forms. Form A and Form B. Form A has a datagrid that is populated from a SQL Database Table query. When a button is pressed Form B is launched that allows you to add a record to the database table. I need for the datagrid to be refreshed and show the newly added record when I close form B and go back to the parent.

[Code]...

View 2 Replies

Refreshing DataGrid On Parent Form After A Child Form Has Updated DB?

Dec 3, 2009

Basically I have two forms - Form1 has a DataGrid on it (Infragistics) and in the double-click row event it creates an instance of the EditForm and passes along the UniqueId for editing. Once the user saves the changes (if they make changes) - I want the DataGrid on Form1 to refresh. Here is how I thought I could get this to work ... I create a public property called RefreshRequired as boolean. Before unloading the EditForm it sets this property to true. Then Unloads. This continues the code in Form1 (which showed the EditForm as modal) but RefreshRequired is still showing as False? Why isn't my EditForm able to set the property?

FORM 1
Private Sub grdList_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles grdList.DoubleClick
' TODO Ignore Double-Click Event when Right Mouse Button Triggers Event

[code]....

View 1 Replies

Stop All The Functions On Parent Form While Child Form Is Still On Screen?

May 1, 2009

form1 has datagridview, when I click "add new", form2 appears(details view, allowing me to add new records into datagridview on form1). when I click "add new" again, form2 appears again, if I click x times, form2 will appear x times. How do I stop the add new button and all the functions on form1 from working until form2 is closed?

View 6 Replies

Update Open Child Mdi Form Textbox From Parent Form?

Feb 3, 2012

I have a date selector on mdi parent that updates a property when date is changed. When I open a child form, it grabs the property just fine. However if I change the date again after the child is open the date does not change on the child unless I close and reopen the form as expected. What would be the best way to automatically update all open child forms when the date is changed on the parent at anytime? running a timer to parse the date property is impractical.

View 2 Replies

Updating Parent Form From Dataset After Editing In Child Form?

Aug 24, 2009

I have two forms....Mainform is filled with controls that are databound to a datasource.....then I have a child form that is used to edit data from parent form.......the data that is displayed on the child form uses the Filter() method of the binding source to display data only for the customer selected......

The child form has the standard OK and CANCEL buttons set up as dialog result.......after I edit the content in child form, the changes are displayed on the child form correctly......but when closing the child form and going back to the parent form the changes dont appear there unless I restart the application.....I also tried adding the tableadapter.update/fill method in the 'OK' dialog result event handler and it still doesnt work......

How can I make the changes take effect on the parent form without restarting the application?

View 2 Replies

Winforms - Disable The Parent Form When Call A Child Form?

May 14, 2010

How can I disable the parent form when I call a child form?This code doesn't disable the parent form like I thought it would:

frmChild.ShowDialog()

View 2 Replies

Create New Instance Of A Form That Does Not Close Then The Parent Form Closes?

Oct 28, 2009

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

[code]....

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

Accessing Variables On A Parent Form From A Child Form

Aug 13, 2011

I have an array of variables called VolumeArray(12) which is declared as publlic shared in the main form1.I have a second form2 which allows the user to input various values. When this form2 is closed, I need the data the user has entered to update the values for VolumeArray(12) within Form1.

View 3 Replies

C# - Access A Value That Is Entered Into A Child Form From A Parent Form?

Jan 10, 2011

Communication between form can be done in many ways using constructor using delegates etc in .net but my question is how can i access a value that is entered into a child form from a parent form or can a two way communication is possible between windows forms.

View 1 Replies







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