473,705 Members | 2,383 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to minimize form owner when a form is minimized?

Don
If you have a form that calls another form via the following code:

Dim myForm as Form2
myForm = New Form2
myForm.Owner = Me
MyForm.ShowDial og

and you minimize the second form, the first form remains visible (albeit
completely disabled).

Is there anyway to make a form's owner minimize when a form is minimized?

- Don
Nov 21 '05 #1
3 5430
if you are createing the form on the fly before the control has added it, I
belive that code below will work
"Don" <un*****@oblivi on.com> wrote in message
news:58ZRe.6160 8$Hk.14827@pd7t w1no...
If you have a form that calls another form via the following code:

Dim myForm as Form2
myForm = New Form2
myForm.Owner = Me
MyForm.ShowDial og

and you minimize the second form, the first form remains visible (albeit
completely disabled).

Is there anyway to make a form's owner minimize when a form is minimized?

- Don

Nov 21 '05 #2
Don
Yes, the form is being created on-the-fly, but the code below does not work.
Just try it. Create a project with two forms, then write that code in the
first form's Click event or something. If you minimize the owned form, the
owner still stays visible. :-(
"Chris" <cc*********@ho tmail.com> wrote in message
news:us******** ********@TK2MSF TNGP10.phx.gbl. ..
if you are createing the form on the fly before the control has added it,
I belive that code below will work
"Don" <un*****@oblivi on.com> wrote in message
news:58ZRe.6160 8$Hk.14827@pd7t w1no...
If you have a form that calls another form via the following code:

Dim myForm as Form2
myForm = New Form2
myForm.Owner = Me
MyForm.ShowDial og

and you minimize the second form, the first form remains visible (albeit
completely disabled).

Is there anyway to make a form's owner minimize when a form is minimized?

- Don


Nov 21 '05 #3
I am learning VB and tried a few things to see if I could get it to work as I
may want to do this for my apps.

Here's what I tried:

Private Sub Form2_Activated (ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Activate d
Me.Owner.Show()
End Sub

Private Sub Form2_Deactivat e(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Deactiva te
Me.Owner.Hide()
End Sub

The negative is that if you click another application or otherwise lose
focus of Form2, Form1 hides itself.

The other option I thought of was to set the Minimize Box and/or the
Maximize Box properties to False at design time (or Control Box). This way
the user must deal with Form2 before going forward. Look at other
applications that pop a dialog box. Many of them don't even allow the user
to minimize or maximize the box.

Hope that helps.

Tony
"Don" wrote:
Yes, the form is being created on-the-fly, but the code below does not work.
Just try it. Create a project with two forms, then write that code in the
first form's Click event or something. If you minimize the owned form, the
owner still stays visible. :-(
"Chris" <cc*********@ho tmail.com> wrote in message
news:us******** ********@TK2MSF TNGP10.phx.gbl. ..
if you are createing the form on the fly before the control has added it,
I belive that code below will work
"Don" <un*****@oblivi on.com> wrote in message
news:58ZRe.6160 8$Hk.14827@pd7t w1no...
If you have a form that calls another form via the following code:

Dim myForm as Form2
myForm = New Form2
myForm.Owner = Me
MyForm.ShowDial og

and you minimize the second form, the first form remains visible (albeit
completely disabled).

Is there anyway to make a form's owner minimize when a form is minimized?

- Don



Nov 21 '05 #4

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

Similar topics

2
2595
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 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()
3
4096
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 minimize the parent form when my child form gets minimized. How to do this? Please let me know as early as possible --
3
3081
by: Robert W. | last post by:
I have a separate thread that handles data transfer operations (with a mobile device). I've set things up so that a small notification form is displayed in the lower right corner of the window. This all works fine. But what I can't figure out how to do is to get it to display on top of my main form, if the main form is maximized. I've tried all of the following: statusForm = new frmNotify(); statusForm.Show(); // Display...
8
47283
by: Terry Olsen | last post by:
I want to minimize my program to the tray when minimized. But there's no "minimize" event. So how can I catch this event and use it?
2
5080
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 catch the event that is trigged when the little underscore(the minimize icon) up to the right is clicked. I need to catch this event because all my child window forms must also be minimized
8
4546
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 Thanks
11
4285
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 minimized, how do I prevent this? Thanks!
4
7210
by: Hutch | last post by:
I also un-checked all of the check boxes in the database's Startup options menu. I then added a button to the form so that the user can close the database, and another button so that the form can minimized. I made the minimize button so that when it was used, something would show-up on the taskbar and not on the desktop (above the Start button). I figured the users would get confused when they had multiple windows open and couldn't find the...
5
10771
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 server. Now, every console program instance will open a command mode window and they occupy the whole screen. I want to minimize all of them and maximize it if neccessary by manual. Is it possible and how to do it? I'm using VB.NET 2005. ...
0
8767
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
9273
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9030
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8979
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5933
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4439
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4703
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3137
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 we have to send another system
2
2486
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.