473,508 Members | 2,104 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[gui] closing or hiding a parent form

Dear all,

Is it possible to close or hide a parent form?

In particular, is it possible to do from the child form itself?

Thanks

Thorsten
Nov 17 '05 #1
4 2201
Hi,

Pass the parent form as part of the constructor of the child form, then as
needed call Hide()
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Thorsten Ottosen" <th***@wmdata.com> wrote in message
news:42***********************@news.sunsite.dk...
Dear all,

Is it possible to close or hide a parent form?

In particular, is it possible to do from the child form itself?

Thanks

Thorsten

Nov 17 '05 #2

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:OB**************@TK2MSFTNGP14.phx.gbl...
Hi,

Pass the parent form as part of the constructor of the child form, then
as needed call Hide()


For some reason this does not work as I expect.

-Thorsten
Nov 17 '05 #3
hi

post the code you are using

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Thorsten Ottosen" <th***@wmdata.com> wrote in message
news:42***********************@news.sunsite.dk...

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us>
wrote in message news:OB**************@TK2MSFTNGP14.phx.gbl...
Hi,

Pass the parent form as part of the constructor of the child form, then
as needed call Hide()


For some reason this does not work as I expect.

-Thorsten

Nov 17 '05 #4

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:eX**************@TK2MSFTNGP14.phx.gbl...
hi

post the code you are using


Can't do that; sorry.

But I can describe the situation a little better (something I should have
done the first time :-()

We start with the parent form:

using(frmMedarbejderListe f = new frmMedarbejderListe(
m_erMedarbejdersErindringer ) )
{
f.Open( this );
}

Then in the child form I do

public override void Open( Form parent )
{
frmMedarbejderSoeg fader = parent as frmMedarbejderSoeg;
fader.Hide(); // #2
Debug.Assert( fader.Visible == false );

base.Open( parent ); // #2
}

base.Open(parent) does various stuff, but ends up calling this.ShowDialog();

Now, the funny this is that if reorder the lines marked #1 and #2, the
parent form is not
hidden...when I look behind the child window, the parent form is still
there;

If I don't reorder the two lines, the parent form is hidden, but the screen
flickers
a bit before the child window appears proproly on the screen.

Neither behavior is particular good.

br

Thorsten
Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1101
by: Kathy D | last post by:
I have created an mdi parent form with four children. I want to disable closing the four children but allow closing the parent form. I created a FormClosing event on each form. That event tests...
1
5798
by: Chris Bruce | last post by:
In my application I need a way to distiguish between the following events: 1. When a user closes an MDI child window. 2. When the user closes the MDI parent window which subsequently closes the...
5
8193
by: Tarun Mangla | last post by:
Hi I am facing a problem. I've made an application in which two forms are there. One if Login form and another is main form. The problem is that, after getting authenticated from the database...
6
3214
by: Gary Miller | last post by:
Does anyone know how to detect a modeless form on closing by the form that invoked the modeless form? form.Show();
17
4194
by: MumboJumbo | last post by:
Hi I have a really basic question hopefully some can help me with: Can you write a (i.e. one) C# project that works from the cmd line and gui? I seems if i write a GUI app it can't write to...
10
3983
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
3
1340
by: Sumit | last post by:
HI.. I am having problem ot determine that a parent form is closing or not in my VB.Net code Any help Sumit
3
6351
by: Oenone | last post by:
I'm writing an application with various MDI child forms. In the Closing event of many of the forms, I have code that asks the user whether he is sure he wants to close the form, because it...
12
1474
by: kronecker | last post by:
I found this nifty routine that closes a form one by one every time it is called. However, I need to hide them instead of closing them. Is there a way to alter the code? I assume it has something...
0
7125
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7388
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7049
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7499
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5631
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5055
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1561
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
767
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
422
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.