472,371 Members | 1,479 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,371 software developers and data experts.

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 4356
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: David Lauberts | last post by:
Hi Wonder if someone has some words of wisdom. I have a access 2002 form that contains 2 graph objects that overlay each other and would like to export them as a JPEG to use in a presentation....
2
by: Paul Mars | last post by:
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....
14
by: Galen Somerville | last post by:
My current screen resolution is set to 1024 x 768. My form size always comes up as 1032 x 748. I have tried the help sample ' Retrieve the working rectangle from the Screen class ' using the...
3
by: blackrunner | last post by:
ERROR in my Query?! ERROR: Element GESCHLECHT is undefined in FORM. i think everything ok. Maby somebody can help me here Element GESCHLECHT is undefined in FORM. The error occurred...
14
by: jmDesktop | last post by:
I have a food menu. Each area, like beverages, grill, etc. have items under them, Coke, Tea, Coffee would be under beverages for example. I want to add a new drink to beverages. In my database...
1
by: deshaipet | last post by:
Hi friends - I created a automatic storage tablespace with a pagesize of 16 K and initial size of 64 MB. create large tablespace test_tbsp1 pagesize 16k managed by automatic storage autoresize...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

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.