473,511 Members | 14,825 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Center one form over another + height of title bar

Hi Guys and Gals,

I have a couple of problems related to centering forms on top of each other.
I have a winforms app that has a status form that I want to popup in the
center of my main form when some processing is taking place. In order to do
this I need to find out the following information:
1. Where is my main form on the (current) screen in relation to the screen's
0,0 point? Once I have the location I can work out where the sub form needs
to go easily.
2. How do I set the coordinates of the sub form in relation to the current
screen's 0,0 point?
3. What is the height of the title-bar. My status form has a blank text
property and as a result no title bar. Stupidly, the .net framework then
resets the location of the controls and shifts them all up by the height of
the title bar. But it leaves the form the same size. Which means that the
form now has a big empty patch at the bottom of it. Apparently I need to
programmatically adjust the height of my form to allow for this, hence my
question.

Regards

Greg
Nov 15 '05 #1
1 1832
> [centring one form relative to another]

Form's StartPosition property might be useful for you. It can be set to
CenterParent or CenterScreen, among other things.
What is the height of the title-bar.


SystemInformation.CaptionHeight.

P.
Nov 15 '05 #2

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

Similar topics

10
26848
by: john T | last post by:
Is there anyway to vertically center a html table using css in such a way it does not alter the html table. When I tryied it just screws up.
2
1896
by: Mr. Clean | last post by:
Why would this work: <html> <head> <title>Page 1</title> </head> <body style="background:#C2BFA5;"> <span style="text-align: center; border:thin inset; position:absolute; left:14px;
8
25458
by: | last post by:
How do you center, like I am trying to do, below the group of images? Why does it not work? Example: <div><h2>The Title</h2><img src="images/BigPicture.jpg" height="150px" width="250px"></div>...
1
3369
by: dumblede | last post by:
Hello fellows, i would like to center a 800px wide 600px high content area without using frames. I have "come up" with the following solution so far. It works under IE 6.0, Firefox 1 (under...
1
3468
by: judacris | last post by:
I've seen the threads here about molding 2 divs in a centered fashion. but I can't seem to solve this thing. my blogger blog is functioning well on my site for now, but the blog feed (left) and...
2
1591
by: rowe_newsgroups | last post by:
Hello all, I have something I believe is something simple, but I can't seem to figure out what to do. I did some searching, but I either can't get my search right. Anyways, on a new webpage I'm...
5
19641
iam_clint
by: iam_clint | last post by:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta...
24
3575
by: GloStix | last post by:
I'm trying to center this banner, it's in a div that has the same width so it's not exactly "centering" but it's screwed up, It works in safari but in Firefox it's messed up. I uploaded a Video to...
2
2752
by: jerrygadd | last post by:
Can some body help me vertically center an image using CSS? The customer only uses IE, and so the code is not debugged for other browsers! The image in question is found on line 1075 :...
0
7252
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7371
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
7432
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
5676
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5077
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...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.