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

Open Form Maximzed and ShowDialog with Task Bar?

Hi,

I have some very specific needs, and I am not able to find a nice solution.
What I need is:
- when the user makes a choice in the Menu, the Form of his choice must
open, but:
- this Form must open Maximized
- and the user shouldn't be able to see the 'Main application' until he
closed this Form!

At first sight I tried it with MyNewForm.ShowDialog(Me).
The problem is that when MyNewForm.WindowState = Maximized, it opens before
the Task Bar! Which I don't want it to do!

I could open it WindowState = norma, and adjust it's Width en Height to the
screen-size, but that gives me another problem: When a Form is not
Maximized, the user can do a drag and drop with the Form, and replace it, so
a part of it won't be anymore on the Screen. This is behaviuo that I don't
want...

I know that my demands are maybe a little to demanding, but the problem is
that this application is for people who aren't mentally at the level we
would like them to have, so it needs to be really basic and exactly like
this so they can't get confused (which they do now :-( ).

Thanks a lot in advance,

Pieter
Dec 2 '05 #1
9 1444
mhhh i am missing my first answer. Ok let's do it a second time ;)

Maybe you can explain what you mean with:

when MyNewForm.WindowState = Maximized, it opens before
the Task Bar! Which I don't want it to do!

I tried to understand that, but i cannot get it.

Dec 2 '05 #2
This would be easier with a bit more code, but why not just Hide the current
form, and display the new one as per normal?

E.g.:
Me.Hide()
MyNewForm.WindowState = Maximized
MyNewForm.Show()

You will of course need to show the parent form (Me above) when MyNewForm is
closed.

Jevon
"Pieter" <pi**********@hotmail.com> wrote in message
news:Ow**************@TK2MSFTNGP10.phx.gbl...
Hi,

I have some very specific needs, and I am not able to find a nice
solution. What I need is:
- when the user makes a choice in the Menu, the Form of his choice must
open, but:
- this Form must open Maximized
- and the user shouldn't be able to see the 'Main application' until he
closed this Form!

At first sight I tried it with MyNewForm.ShowDialog(Me).
The problem is that when MyNewForm.WindowState = Maximized, it opens
before the Task Bar! Which I don't want it to do!

I could open it WindowState = norma, and adjust it's Width en Height to
the screen-size, but that gives me another problem: When a Form is not
Maximized, the user can do a drag and drop with the Form, and replace it,
so a part of it won't be anymore on the Screen. This is behaviuo that I
don't want...

I know that my demands are maybe a little to demanding, but the problem is
that this application is for people who aren't mentally at the level we
would like them to have, so it needs to be really basic and exactly like
this so they can't get confused (which they do now :-( ).

Thanks a lot in advance,

Pieter

Dec 2 '05 #3
Hehe ok I didn't explain it very good. what I meant was: If you open a Form
as ShowDialog, and it is maximzed, it will take the whole screen, also where
the Taskbar (the thing at the bottom of the screen with the Start-button
etc) is normally shown... A normal Form that is maximized will take the
whole screen, except the taskbar at the bottom of the screen.

So the summary:
MyNewForm.WindowState = Maximized
MyNewForm.ShowDialog(Me)
-> The height of MyNewform will be = Screen.Height

if you do instead:
MyNewForm.WindowState = Maximized
MyNewForm.Show
-> The height of MyNewform will be = Screen.Height -
TheHeightOfTheTaskbar :-) -> it's this that I want :-)
"necroph" <ne*****@aol.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
mhhh i am missing my first answer. Ok let's do it a second time ;)

Maybe you can explain what you mean with:

when MyNewForm.WindowState = Maximized, it opens before
the Task Bar! Which I don't want it to do!

I tried to understand that, but i cannot get it.

Dec 2 '05 #4
Hi Pieter,

can you just explain what you mean with: The problem is that when
MyNewForm.WindowState = Maximized, it opens before
the Task Bar!
I tried to understand that but i cannot get it.

Dec 2 '05 #5
I just had the same problem, when i wanted to write a screenSaver. The
property i was looking for is FormBorderStyle. Set it to 'none' and the
user has no chance to move it. Set TopMost = true and the user cannot
even use alt+tab to switch between applications. Of course you has to
create a 'Closebutton' (OnClick: me.close) because FormBorderStyle =
none hides the complete windowcontrolls and just shows your form.
Otherwise i have othrt little solutions in my mind like setting
policies in the reg.

Dec 2 '05 #6
I recognized that i was wrong. But I tested:

MyNewForm.WindowState = Maximized
MyNewForm.Showdialog()

but the taskbar is normaly shown. The 'MyNewForm' is not hiding the
taskbar.

Dec 2 '05 #7
Pieter,

You know that it is hard not to write what I want to write.
I don't find it right in this case.

:-)

Can you try those?
\\\
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim frm As New Form2
frm.MaximizeBox = False
frm.WindowState = FormWindowState.Maximized
frm.ShowInTaskbar = False
frm.ShowDialog(Me)
End Sub
End Class
///

\\\
Public Class Form2
Protected Overrides ReadOnly _
Property CreateParams() As CreateParams
Get
Dim cp As CreateParams = MyBase.CreateParams
cp.ClassStyle = &H8
Return cp
End Get
End Property
End Class
///

'The last part with thanks to Mick Doherty, he made this for a non closing
window.

I hope this helps,

Cor
Dec 2 '05 #8
See the answer of Armin Zingler: It doesn't show the Form in the workign
Area, but on the whole Screen :-)

"necroph" <ne*****@aol.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
Hi Pieter,

can you just explain what you mean with: The problem is that when
MyNewForm.WindowState = Maximized, it opens before
the Task Bar!
I tried to understand that but i cannot get it.

Dec 2 '05 #9
Not too bad your solution, thanks! :-)

And indeed It works like that, but I forgot to mention one thing:
MaximizeBox = False of the form, because user shouldn't be able to resize
it...

"necroph" <ne*****@aol.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
I recognized that i was wrong. But I tested:

MyNewForm.WindowState = Maximized
MyNewForm.Showdialog()

but the taskbar is normaly shown. The 'MyNewForm' is not hiding the
taskbar.


Dec 3 '05 #10

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

Similar topics

10
by: Pieter | last post by:
Hi, I have some very specific needs, and I am not able to find a nice solution. What I need is: - when the user makes a choice in the Menu, the Form of his choice must open, but: - this Form...
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...
1
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...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
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.