469,331 Members | 1,782 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,331 developers. It's quick & easy.

form useable area

How can I get the useable dimensions or coordinates of the working area of a
form?

All that I can find return the monitor screen area, but I need the usable
area inside the open form. Not incl. menu, toolbar, status bar.
Dim x As Integer = MdiParent.Height

Me.SetDesktopBounds(0, 0, 0, 0)

'Me.SetDesktopLocation(0, 0)

'Me.Top = CInt(MdiParent.ClientSize.Height)

'Me.Top = CInt(Screen.PrimaryScreen.Bounds.Height)
Nov 20 '05 #1
12 4145
Did you look at Form.ClientSize ?

The rest is basics - usable area starts at (0,0) and up to Width-1 and
Height-1.

HTH
Alex

"Paul Mars" <pa************@netzero.com> wrote in message
news:OE***************@TK2MSFTNGP11.phx.gbl...
How can I get the useable dimensions or coordinates of the working area of a form?

All that I can find return the monitor screen area, but I need the usable
area inside the open form. Not incl. menu, toolbar, status bar.
Dim x As Integer = MdiParent.Height

Me.SetDesktopBounds(0, 0, 0, 0)

'Me.SetDesktopLocation(0, 0)

'Me.Top = CInt(MdiParent.ClientSize.Height)

'Me.Top = CInt(Screen.PrimaryScreen.Bounds.Height)

Nov 20 '05 #2
Hi,

Dim frm As New Form1

frm.MdiParent = Me
frm.Width = Me.ClientSize.Width - 5
frm.Height = Me.ClientSize.Height - 25
Ken
----------------
"Paul Mars" <pa************@netzero.com> wrote in message
news:OE***************@TK2MSFTNGP11.phx.gbl...
How can I get the useable dimensions or coordinates of the working area of
a
form?

All that I can find return the monitor screen area, but I need the usable
area inside the open form. Not incl. menu, toolbar, status bar.
Dim x As Integer = MdiParent.Height

Me.SetDesktopBounds(0, 0, 0, 0)

'Me.SetDesktopLocation(0, 0)

'Me.Top = CInt(MdiParent.ClientSize.Height)

'Me.Top = CInt(Screen.PrimaryScreen.Bounds.Height)

Nov 20 '05 #3
yes and that does not work.

Me.Top = CInt(MdiParent.ClientSize.Height)
puts the Me form down below the visible bottom of screen, so then user needs
to scroll to see it. And
Me.Top = CInt((MdiParent.ClientSize.Height - Size.Height) / 2)

puts the Me form below the middle of useable form screen area.

Both these will work for setting the first form on my screen, but setting a
child form inside a parent is not working.

P
"AlexS" <sa***********@SPAMsympaticoPLEASE.ca> wrote in message
news:e$****************@TK2MSFTNGP12.phx.gbl...
Did you look at Form.ClientSize ?

The rest is basics - usable area starts at (0,0) and up to Width-1 and
Height-1.

HTH
Alex

"Paul Mars" <pa************@netzero.com> wrote in message
news:OE***************@TK2MSFTNGP11.phx.gbl...
How can I get the useable dimensions or coordinates of the working area of
a
form?

All that I can find return the monitor screen area, but I need the

usable area inside the open form. Not incl. menu, toolbar, status bar.
Dim x As Integer = MdiParent.Height

Me.SetDesktopBounds(0, 0, 0, 0)

'Me.SetDesktopLocation(0, 0)

'Me.Top = CInt(MdiParent.ClientSize.Height)

'Me.Top = CInt(Screen.PrimaryScreen.Bounds.Height)


Nov 20 '05 #4
Hi,

Dim frm As New Form1

frm.MdiParent = Me
frm.Width = Me.ClientSize.Width - 5
frm.Height = Me.ClientSize.Height - 25
Ken
----------------
"Paul Mars" <pa************@netzero.com> wrote in message
news:OE***************@TK2MSFTNGP11.phx.gbl...
How can I get the useable dimensions or coordinates of the working area of
a
form?

All that I can find return the monitor screen area, but I need the usable
area inside the open form. Not incl. menu, toolbar, status bar.
Dim x As Integer = MdiParent.Height

Me.SetDesktopBounds(0, 0, 0, 0)

'Me.SetDesktopLocation(0, 0)

'Me.Top = CInt(MdiParent.ClientSize.Height)

'Me.Top = CInt(Screen.PrimaryScreen.Bounds.Height)

Nov 20 '05 #5
in my project
MDIParent.ClientSize.Height - 100 or
Screen.PrimaryScreen.Bounds.Height - 180

either one works. I just thought that there would(should) be a way to return
the useable open space. I guess not. This still works if I change
resolution. I hope that it works on different computers.

Paul

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:eo**************@TK2MSFTNGP11.phx.gbl...
Hi,

Dim frm As New Form1

frm.MdiParent = Me
frm.Width = Me.ClientSize.Width - 5
frm.Height = Me.ClientSize.Height - 25
Ken
----------------
"Paul Mars" <pa************@netzero.com> wrote in message
news:OE***************@TK2MSFTNGP11.phx.gbl...
How can I get the useable dimensions or coordinates of the working area of a
form?

All that I can find return the monitor screen area, but I need the usable area inside the open form. Not incl. menu, toolbar, status bar.
Dim x As Integer = MdiParent.Height

Me.SetDesktopBounds(0, 0, 0, 0)

'Me.SetDesktopLocation(0, 0)

'Me.Top = CInt(MdiParent.ClientSize.Height)

'Me.Top = CInt(Screen.PrimaryScreen.Bounds.Height)


Nov 20 '05 #6
"Paul Mars" <pa************@netzero.com> schrieb
yes and that does not work.

Me.Top = CInt(MdiParent.ClientSize.Height)
puts the Me form down below the visible bottom of screen, so then
user needs to scroll to see it. And
Me.Top = CInt((MdiParent.ClientSize.Height - Size.Height) / 2)

puts the Me form below the middle of useable form screen area.

Both these will work for setting the first form on my screen, but
setting a child form inside a parent is not working.

What's your intention? Where do you want to move the child to?
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #7
in my project
MDIParent.ClientSize.Height - 100 or
Screen.PrimaryScreen.Bounds.Height - 180

either one works. I just thought that there would(should) be a way to return
the useable open space. I guess not. This still works if I change
resolution. I hope that it works on different computers.

Paul

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:eo**************@TK2MSFTNGP11.phx.gbl...
Hi,

Dim frm As New Form1

frm.MdiParent = Me
frm.Width = Me.ClientSize.Width - 5
frm.Height = Me.ClientSize.Height - 25
Ken
----------------
"Paul Mars" <pa************@netzero.com> wrote in message
news:OE***************@TK2MSFTNGP11.phx.gbl...
How can I get the useable dimensions or coordinates of the working area of a
form?

All that I can find return the monitor screen area, but I need the usable area inside the open form. Not incl. menu, toolbar, status bar.
Dim x As Integer = MdiParent.Height

Me.SetDesktopBounds(0, 0, 0, 0)

'Me.SetDesktopLocation(0, 0)

'Me.Top = CInt(MdiParent.ClientSize.Height)

'Me.Top = CInt(Screen.PrimaryScreen.Bounds.Height)


Nov 20 '05 #8
"Paul Mars" <pa************@netzero.com> schrieb
yes and that does not work.

Me.Top = CInt(MdiParent.ClientSize.Height)
puts the Me form down below the visible bottom of screen, so then
user needs to scroll to see it. And
Me.Top = CInt((MdiParent.ClientSize.Height - Size.Height) / 2)

puts the Me form below the middle of useable form screen area.

Both these will work for setting the first form on my screen, but
setting a child form inside a parent is not working.

What's your intention? Where do you want to move the child to?
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #9
1 - minimize a child form to lower left. There is a minimize method, but it
is not working.

2 - A child is displayed in center of Parent, then it is made larger. When
it is made larger, I want it still center of Parent. Then it is made smaller
again and it needs to be re-centered.

paul

"Armin Zingler" <az*******@freenet.de> wrote in message
news:40***********************@news.freenet.de...

What's your intention? Where do you want to move the child to?

Nov 20 '05 #10
1 - minimize a child form to lower left. There is a minimize method, but it
is not working.

2 - A child is displayed in center of Parent, then it is made larger. When
it is made larger, I want it still center of Parent. Then it is made smaller
again and it needs to be re-centered.

paul

"Armin Zingler" <az*******@freenet.de> wrote in message
news:40***********************@news.freenet.de...

What's your intention? Where do you want to move the child to?

Nov 20 '05 #11
"Paul Mars" <pa************@netzero.com> schrieb
1 - minimize a child form to lower left. There is a minimize method,
but it is not working.
I didn't find a Minimize method. Though, when I manually minimize the child,
it's located at the bottom left of the parent, as expected. This also works
when setting the minimized WindowState in code.
2 - A child is displayed in center of Parent, then it is made larger.
When it is made larger, I want it still center of Parent. Then it is
made smaller again and it needs to be re-centered.


This is done by

Me.Top = CInt((MdiParent.ClientSize.Height - Size.Height) / 2)

It works here. The only thing you have to subtract is a 4 pixel border not
covered by MDI child windows, so it's:

Me.Top = (MdiParent.ClientSize.Height - 4 - Size.Height) \ 2

Now it's centered (vertically). I'm not sure if it's always 4 pixels.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #12
"Paul Mars" <pa************@netzero.com> schrieb
1 - minimize a child form to lower left. There is a minimize method,
but it is not working.
I didn't find a Minimize method. Though, when I manually minimize the child,
it's located at the bottom left of the parent, as expected. This also works
when setting the minimized WindowState in code.
2 - A child is displayed in center of Parent, then it is made larger.
When it is made larger, I want it still center of Parent. Then it is
made smaller again and it needs to be re-centered.


This is done by

Me.Top = CInt((MdiParent.ClientSize.Height - Size.Height) / 2)

It works here. The only thing you have to subtract is a 4 pixel border not
covered by MDI child windows, so it's:

Me.Top = (MdiParent.ClientSize.Height - 4 - Size.Height) \ 2

Now it's centered (vertically). I'm not sure if it's always 4 pixels.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.