473,387 Members | 1,834 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,387 software developers and data experts.

Minimize ParentForm when its child form is minimized

Tai
Hi all

I have 2 forms, frmMain and frmChild.
In frmMain, I declare a variable f as frmChid then Call f.ShowDialog()
I want when the child form is minimized, the Main form is also minimized automatically.
I tried some way to call frmMain.WindowState = FormWindowState.Minimized.
The result is my 2 forms are minimized but the side effect is the Child form is gone.

Dim f As New frmChild
f.ShowDialog()
Debug.WriteLine("ShowDialog Returned")

When the main form is minized, I saw that f.ShowDialog is also returned.
It makes my child form goes away.

I appriciate much your help.
Tai Le

Jul 21 '05 #1
2 2564
Hi Tai,

Do you mean something as this?
(And please do not multipost)

A side effect is that it minimize the dialogbox and not the form.
When you give the text of your dialogforms the same name, nobody sees that.

I hope this helps?

Cor
\\\
Private Sub FormDialog_Resize(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Resize
If Me.WindowState = FormWindowState.Minimized Then
Me.Owner.Visible = False
Else
Me.Owner.Visible = True
End If
End Sub
///
Jul 21 '05 #2
Tai
Thank you very much Cor
It helped me to solve my problem
Actually I used Me.Owner.Opacity

If Me.WindowState = FormWindowState.Minimized Then
Me.Owner.Opacity = 0
Else
If Not Me.Owner Is Nothing AndAlso Me.Owner.Opacity = 0 Then
Me.Owner.Opacity = 100
End If
End If

A doubled post because I posted once, The Compose window said that An error Occured, then I tried to re-post. the result is 2 posts :-)

Again, thank you very much
Tai
"Cor Ligthert" wrote:
Hi Tai,

Do you mean something as this?
(And please do not multipost)

A side effect is that it minimize the dialogbox and not the form.
When you give the text of your dialogforms the same name, nobody sees that.

I hope this helps?

Cor
\\\
Private Sub FormDialog_Resize(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Resize
If Me.WindowState = FormWindowState.Minimized Then
Me.Owner.Visible = False
Else
Me.Owner.Visible = True
End If
End Sub
///

Jul 21 '05 #3

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

Similar topics

0
by: Tai | last post by:
Hi all I have 2 forms, frmMain and frmChild. In frmMain, I declare a variable f as frmChid then Call f.ShowDialog() I want when the child form is minimized, the Main form is also minimized...
3
by: Nagachandra Sekhar Grandhi | last post by:
Hi, I am opening a dialog box (which is also a form) after clicking a button in the main form using ".ShowDialog(this)". There is a minimize button for the opened dialog box(form). I want to...
3
by: al | last post by:
Greetings, What is the method to use to get all MDI child forms to minimize. That is, if there are four open MDI child forms, how can I have them all minimized in one method call? MTIA,...
2
by: andreas | last post by:
Hi, How to minimize with code all de childforms in the parentform. I want to put a menuitem with text "MInimize all" in a parent form to minimize all the child forms in the parent form at once....
1
by: Tai | last post by:
Hi all I have 2 forms, frmMain and frmChild. In frmMain, I declare a variable f as frmChid then Call f.ShowDialog() I want when the child form is minimized, the Main form is also minimized...
2
by: tony | last post by:
Hello! I have a mainManu where I can chose to display some window forms. When the mainMenu is minimized I need to minimize every window form that is started from the mainMenu. So I need to...
8
by: Avi G | last post by:
Hi, i've created an application and i want it to be minimized to the sys tray, how i do it? if you can direct me step by step even with create a small application and put it in the sys tray ...
11
by: M O J O | last post by:
Hi, I'm creating my own Sidebar (like in Vista). In my XP's quick menu, I have a button called "Show Desktop". When I click it all forms are minimized. Since I don't want my SideBar to be...
5
by: =?Utf-8?B?SmFtZXMgV29uZw==?= | last post by:
Dear all, I'd like to know if there is any method to minimize command mode window when a console program is running. In my case, there are several console programs which run periodically in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.