473,239 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,239 software developers and data experts.

close hide

Hi

I'm trying to make something i tought is was simple

if i press the cross on the childform to close it, i want it to hide.
but when i press a button on the parrent i want to close the child.

so on the child i made a formclosing handler an in the handler i put:
this.hide();

now on the parrentform i do:
parrentform.Close();

but... ofcourse when i do this the closing eventhandler on the form is
called and the form hides itselfe.

what can i do?



Dec 8 '05 #1
4 2412
Maarten,

Expose a flag on the child form which indicates whether or not the
parent form is closing it. Before the parent form closes the child form,
set the flag to true.

Then, in your form closing event handler, check the flag. If the flag
is true, then do not hide the form and cancel the event, rather, just let it
close.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Maarten" <gu******@hotmail.com> wrote in message
news:43***********************@news.skynet.be...
Hi

I'm trying to make something i tought is was simple

if i press the cross on the childform to close it, i want it to hide.
but when i press a button on the parrent i want to close the child.

so on the child i made a formclosing handler an in the handler i put:
this.hide();

now on the parrentform i do:
parrentform.Close();

but... ofcourse when i do this the closing eventhandler on the form is
called and the form hides itselfe.

what can i do?


Dec 8 '05 #2
how can i indicate wether the form itselve or the Parrent is closing it?
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:#9**************@TK2MSFTNGP11.phx.gbl...
Maarten,

Expose a flag on the child form which indicates whether or not the
parent form is closing it. Before the parent form closes the child form,
set the flag to true.

Then, in your form closing event handler, check the flag. If the flag
is true, then do not hide the form and cancel the event, rather, just let it close.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Maarten" <gu******@hotmail.com> wrote in message
news:43***********************@news.skynet.be...
Hi

I'm trying to make something i tought is was simple

if i press the cross on the childform to close it, i want it to hide.
but when i press a button on the parrent i want to close the child.

so on the child i made a formclosing handler an in the handler i put:
this.hide();

now on the parrentform i do:
parrentform.Close();

but... ofcourse when i do this the closing eventhandler on the form is
called and the form hides itselfe.

what can i do?



Dec 8 '05 #3
Maarten,

Expose a property that the parent form will call which will set a flag
on the child form. Either that, or expose another Close method which the
parent form will call which will set the flag in the child form internally.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Maarten" <gu******@hotmail.com> wrote in message
news:43***********************@news.skynet.be...
how can i indicate wether the form itselve or the Parrent is closing it?
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in
message news:#9**************@TK2MSFTNGP11.phx.gbl...
Maarten,

Expose a flag on the child form which indicates whether or not the
parent form is closing it. Before the parent form closes the child form,
set the flag to true.

Then, in your form closing event handler, check the flag. If the
flag
is true, then do not hide the form and cancel the event, rather, just let

it
close.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Maarten" <gu******@hotmail.com> wrote in message
news:43***********************@news.skynet.be...
> Hi
>
> I'm trying to make something i tought is was simple
>
> if i press the cross on the childform to close it, i want it to hide.
> but when i press a button on the parrent i want to close the child.
>
> so on the child i made a formclosing handler an in the handler i put:
> this.hide();
>
> now on the parrentform i do:
> parrentform.Close();
>
> but... ofcourse when i do this the closing eventhandler on the form is
> called and the form hides itselfe.
>
> what can i do?
>
>
>
>
>
>
>



Dec 8 '05 #4
indeed
thanks this was actualy not that hard.

regards maarten.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:uw**************@TK2MSFTNGP11.phx.gbl...
Maarten,

Expose a property that the parent form will call which will set a flag
on the child form. Either that, or expose another Close method which the
parent form will call which will set the flag in the child form internally.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Maarten" <gu******@hotmail.com> wrote in message
news:43***********************@news.skynet.be...
how can i indicate wether the form itselve or the Parrent is closing it?
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in
message news:#9**************@TK2MSFTNGP11.phx.gbl...
Maarten,

Expose a flag on the child form which indicates whether or not the
parent form is closing it. Before the parent form closes the child form, set the flag to true.

Then, in your form closing event handler, check the flag. If the
flag
is true, then do not hide the form and cancel the event, rather, just let
it
close.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Maarten" <gu******@hotmail.com> wrote in message
news:43***********************@news.skynet.be...
> Hi
>
> I'm trying to make something i tought is was simple
>
> if i press the cross on the childform to close it, i want it to hide.
> but when i press a button on the parrent i want to close the child.
>
> so on the child i made a formclosing handler an in the handler i put:
> this.hide();
>
> now on the parrentform i do:
> parrentform.Close();
>
> but... ofcourse when i do this the closing eventhandler on the form

is > called and the form hides itselfe.
>
> what can i do?
>
>
>
>
>
>
>



Dec 8 '05 #5

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

Similar topics

2
by: Ronny Sigo | last post by:
Hello all, I have to open a readonly Excel sheet from clicking on a button on an access form. So far no problem: Dim ObjXL As Excel.Application Dim ObjXLBook As Excel.Workbook Dim ObjXLSheet As...
1
by: lauren quantrell | last post by:
Before getting pistol whipped, I know this is a well-worn topic but I don't see the answer... I know how to hide the Access window, I know how to disable the Access application's close button, but...
0
by: Lauren Quantrell | last post by:
I use the code below to hide the MS Access Close button and the minimize and maximize buttons. What I want to do is to hide the close button but not the min/max buttons. Is this possible? ...
1
by: Alpha | last post by:
I have a Window based application that shows up still running in the task manager when I close it. It reaches the "this.close" statement and then it stops at the "}" at the section of the...
5
by: Stan Sainte-Rose | last post by:
Hi, Which event is called when the user click on the close window icon (X) ? I want, when he clicks on this icon, to display a message before closing the form. If he replys by No, I don't want to...
5
by: Eric Renken | last post by:
OK, I have a form with a menu and a tool bar. In the Menu I have a File menu that contains a "Exit" item. When I click this Exit item. I have an event wired to: mnuFile.DropDown.ItemClicked ...
3
by: Karan | last post by:
I am calling finalize when form2 loads and deactivates form1 which closes form1. However, same thing is not happening in form2 because finalize is already called. Does anybody has solution to it....
5
by: kimiraikkonen | last post by:
I made a very small (2 forms) application with VB.NET 2005 express and second form contains web-browser component and flash movie inside it. Everything OK but after i close the program via normal...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.