473,394 Members | 1,887 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,394 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 4564
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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...

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.