473,406 Members | 2,217 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,406 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
10 3249
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
"Pieter" <pi**********@hotmail.com> schrieb
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 :-)

It's the "working area" you are looking for. :-)

I can't repro this. If I show the form modally and maximized, it only covers
the working area, not the whole screen. This happens with or without passing
'Me' to ShowDialog. (both, Framework 1.1 and 2.0)
Armin

Dec 2 '05 #9
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 #10
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 #11

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

Similar topics

7
by: TDIOwa | last post by:
I have a form that has a specific date on it. I want to open another form that has the Active Control Calendar on it. I want to open this form to the specific date on the first form. I have...
6
by: vbdev | last post by:
Hi, This is my 3rd post on the issue, but I am getting closer to a solution: I have 1 project with 50 winforms name test01 to test50. These forms have a public method named: MyVal Right...
5
by: twick10 | last post by:
Hi, I am trying to execute a control method on an open form (not with focus) from a modal dialog box. I want to increment the node selected from the dialog when a certain key is pressed. Any...
9
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...
2
by: allyn44 | last post by:
Hello, I have built a serch form for users to edit records. I only want them to pull up the record they need, and I want to check for nulls. There should not be dupes becasue the underlying...
2
by: erick-flores | last post by:
Hello all Form A (pk) & Form B (fk) I want to display my Form B empty whenever is the first time, that the pk form Form A, is enter. I click a button to open Form B. BUT if the pk from Form A...
3
by: kev | last post by:
Hi folks, I have a form for registration (frmRegistration) whereby i have two buttons. One is Save which saves record using the OnClick property. I used wizard to create the save button. The...
14
by: keri | last post by:
Hi, Simple version of the question..... How do I use the where clause of the open form command to show an account with a matching ID to be displayed when the form is opened? Eg. I select a...
3
by: vidhyapriya | last post by:
Hi all I am developing windows application using vb.net.I want to pass values to open form.I am opening only one form when user click the buttons several times.Useing delegate i am passing...
5
by: billa856 | last post by:
Hi, My project is in MS Access 2002. In that I want to open one form multiple times. I put one button on my main form. Now whenever I click on that button than form will be open. Now when I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
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...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.