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

Minimizing forms

Hello again,

I have an application with three forms. Frm1 has a button whose click event
calls frm2 -- frm2.ShowDialog(). Frm2 has a button that calls frm3 --
frm3.ShowDialog(). When I minimize frm3, I want the other two forms to
minimize as well. As I have it now, frm3 minimizes and a small title bar
appears at the lower left of my desktop, and frm2 and frm1 remain in the
center and I cannot touch them because of ShowDialog. (I don't want to use
Show.) How do I get all three forms to minimize?

Thanks,
Nathan
Nov 20 '05 #1
13 1340
Cor
Hi Nathan,

I think with a lot of code. Why not just delete the minimizebox from your
dialogform, no user sees it (it is a dialog, show it is normal that you
cannot minimize it) and the problem is gone.

I hope this helps?

Cor

calls frm2 -- frm2.ShowDialog(). Frm2 has a button that calls frm3 --
frm3.ShowDialog(). When I minimize frm3, I want the other two forms to
minimize as well. As I have it now, frm3 minimizes and a small title bar
appears at the lower left of my desktop, and frm2 and frm1 remain in the
center and I cannot touch them because of ShowDialog. (I don't want to use Show.) How do I get all three forms to minimize?

Nov 20 '05 #2
* "Cor" <no*@non.com> scripsit:
I think with a lot of code. Why not just delete the minimizebox from your
dialogform, no user sees it (it is a dialog, show it is normal that you
cannot minimize it) and the problem is gone.


LOL -- But that won't allow the user to minimize the app at all...

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
Cor
Only from the forms that he start with
frmx.showdialog

The others stays, I think this is quit normal.
I think with a lot of code. Why not just delete the minimizebox from your dialogform, no user sees it (it is a dialog, show it is normal that you
cannot minimize it) and the problem is gone.


LOL -- But that won't allow the user to minimize the app at all...

Nov 20 '05 #4
* "Cor" <no*@non.com> scripsit:
Only from the forms that he start with
frmx.showdialog

The others stays, I think this is quit normal.


OK... Somtimes it would be nice to minimze the whole app, even if modal
dialogs are shown. For example, if the program is showing a modal
progress dialog.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
Cor
You can do that with showdialog?

OK... Somtimes it would be nice to minimze the whole app, even if modal
dialogs are shown. For example, if the program is showing a modal
progress dialog.

(And I mean than not with a bunch of code what can be easier done with show)
Nov 20 '05 #6
To be a little more specific, frm1 is the main form, frm3 is a data entry
form, and frm 2 is the form where the user chooses which part of the
database is to be edited. The reason I've done ShowDialog is because I only
want one process going at one time. What I want should be possible; I've
seen it done with other programs. AVG Antivirus, for instance, when
scanning shows a modal progress dialog, as Herfried mentioned, which, when
minimized, minimizes the whole application.

Besides, even with .Show I can only see how to minimize each of the forms
individually, not all at once.

"Cor" <no*@non.com> wrote in message
news:OP**************@TK2MSFTNGP10.phx.gbl...
You can do that with showdialog?

OK... Somtimes it would be nice to minimze the whole app, even if modal
dialogs are shown. For example, if the program is showing a modal
progress dialog.
(And I mean than not with a bunch of code what can be easier done with

show)

Nov 20 '05 #7
Cor
Hi Nathan,

Here a part of code you can use for what you ask.
But it is absolute not complete,

I hope you succeed?

Cor

\\\
Private WithEvents frm As Form
Private frmOpen As Boolean

Private Sub frm_VisibleChanged(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles frm.VisibleChanged
If frmOpen Then
If frm.WindowState = FormWindowState.Minimized Then
Me.WindowState = FormWindowState.Minimized
Else
Me.WindowState = FormWindowState.Normal
End If
End If
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
frm = New Form2
frm.ShowDialog()
frmOpen = True
End Sub
///
Nov 20 '05 #8
* "Cor" <no*@non.com> scripsit:
You can do that with showdialog?


I don't think so. Maybe there is a way, other apps like WinSCP provide
this feature too (but it's AFAIR written in Delphi).

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #9
Cor
Hi Herfried,

I made it, see the sample, it was less work than I thouht, I had to think at
that procedure I use to show and close 3 forms (another procedure than you
use). With that it was easy.

Look at it it is in this tread, basicly simple but I think some work to be
sure it is all synchronizes.

Cor
You can do that with showdialog?


I don't think so. Maybe there is a way, other apps like WinSCP provide
this feature too (but it's AFAIR written in Delphi).

Nov 20 '05 #10
* "Cor" <no*@non.com> scripsit:
I made it, see the sample, it was less work than I thouht, I had to think at
that procedure I use to show and close 3 forms (another procedure than you
use). With that it was easy.

Look at it it is in this tread, basicly simple but I think some work to be
sure it is all synchronizes.


Nice code!!!

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #11
Cor,

Thanks for the code. I thought I might have to do something like this, but
I was hoping there was an "easier" way. I didn't know exactly how to do it,
though, so I'm glad for your input.

Just a thought--if a modal form is minimized, you can't access the other
form(s). What then is the purpose in them still showing? I would think
they would minimize as well by default?

"Cor" <no*@non.com> wrote in message
news:eq*************@TK2MSFTNGP12.phx.gbl...
Hi Nathan,

Here a part of code you can use for what you ask.
But it is absolute not complete,

I hope you succeed?

Cor

\\\
Private WithEvents frm As Form
Private frmOpen As Boolean

Private Sub frm_VisibleChanged(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles frm.VisibleChanged
If frmOpen Then
If frm.WindowState = FormWindowState.Minimized Then
Me.WindowState = FormWindowState.Minimized
Else
Me.WindowState = FormWindowState.Normal
End If
End If
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
frm = New Form2
frm.ShowDialog()
frmOpen = True
End Sub
///

Nov 20 '05 #12
Hi Cor,

I tried your code and couldn't get it to work. The frm.VisibleChanged only
runs when the form is opened and closed. So I tried frm.SizeChanged, which
runs on opening and minimizing. I put your code in there (tried with and
without checking the boolean value), and when I minimize the second form it
closes, and the first form minimizes. A Msgbox tells me the WindowState of
both forms is Minimized, but the second form has closed altogether. Where
to go from here?
Nov 20 '05 #13
Cor
Hi Nathan,

It is just a sample,

Therefore you have to do it first as a sample and as I wrote it is not
complete.

You have to open a project with2 forms, a button on form1 and than paste the
code in form1.
Then you can start your project
push on button 1 on form1 (you have to leave form1 in normal state)
Form 2 opens,
When you minimize that you will see that form1 minimize also,
When you opens form2 again, form1 will open also.

But the rest you have to do yourself, (maximize state, opens form2 when the
minimize from form1 is openend again etc etc)

I said you have a lot to synchronize in my opinon, therefore my first answer
I gave to you.

Cor

Nov 20 '05 #14

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

Similar topics

13
by: nospam | last post by:
NEWS.COM Amazon wins patent for ordering forms # 6,615,226 http://tinyurl.com/m7v8 http://news.com.com/2100-1017-5070569.html In its latest patent, the online retailing giant outlined a...
3
by: Peter | last post by:
I have a dll written in VB6 that exposes a form. The dll is called from VBA in an Access 2000 application. I need to get the form to minimize when the user minimizes the Access application...
3
by: Chris | last post by:
Modal forms are great for locking the user out of non focused forms allowing tight control over program flow, but they have one side effect which user find very irritating i.e. Access cannot be...
3
by: Don | last post by:
I have a form that displays a second form modally (via ShowDialog). When the second form gets minimized, how do you get the parent form to minimize, too? - Don
0
by: Earl | last post by:
I posted this in the winforms forum awhile back and got no answer. Anyone have an answer? What causes all forms to resize the same as the others within an MDI container? I've noticed that...
5
by: Scott | last post by:
Hi everyone, I have a c# console app that when run through an autorun.inf file, launches a web page from the CD. It works just fine but I would like the console window minimized on startup....
2
by: Ansu | last post by:
Hello All, Iam a newbie in .NET and i need u r help. My Question is "How to Minimize an Application in C#" I tried using the below code ...
3
by: qazplm114477 | last post by:
Hi, I'm having a tiny problem. I have just started playing around with visual basic a week ago so im fairly new at this. I created a method that saves changes when you click a button, once the button...
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
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.