473,508 Members | 2,303 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Center Form Stretching

Ali Rizwan
925 Contributor
Hi all,
I m stretching my form and i want if i stretch its position after stretching must be in middle of screen or i want to stretch centerly.

Thanx
>> ALI <<
Feb 29 '08 #1
5 1292
daniel aristidou
491 Contributor
Hi all,
I m stretching my form and i want if i stretch its position after stretching must be in middle of screen or i want to stretch centerly.

Thanx
>> ALI <<
Set the start up position to center?
Feb 29 '08 #2
Ali Rizwan
925 Contributor
I want this at runtime......

thanx
Feb 29 '08 #3
daniel aristidou
491 Contributor
I want this at runtime......

thanx
Okk.....this is a genral formula

Get the screen size (width)
Divide screen size by 2
Get form size (width)
Divide screen size by 2

Set the form position.left = (0.5 * Screensize) + (0.5 * Form width)
Do the same for the hieght

Hope this helps
Mar 2 '08 #4
Killer42
8,435 Recognized Expert Expert
Correction.

Rather than...
Set the form position.left = (0.5 * Screensize) + (0.5 * Form width)
I'm fairly certain it should be...
Set the form position.left = (0.5 * Screensize) - (0.5 * Form width)
Mar 3 '08 #5
daniel aristidou
491 Contributor
Correction.

Rather than...
Set the form position.left = (0.5 * Screensize) + (0.5 * Form width)
I'm fairly certain it should be...
Set the form position.left = (0.5 * Screensize) - (0.5 * Form width)
Yep your correct killer......
Mar 4 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2067
by: BenOne© | last post by:
Hi all, I'm trying to create an image gallery with CSS but I can't get the thumbnails to center horizontally as a group. The page, including css defined in the <HEAD> is located at:...
21
3040
by: DraguVaso | last post by:
Hi, I have an inherited DataGrid, that does lots of extra stuff. For exemple drawing a backgroundimage in every cell. The problem is that it's taking too much time (using gdi+), so I want to do...
5
3450
by: VMI | last post by:
I have a BMP image (the form is also in PDF) that contains a scanned copy of a paper form that we need to fill out. Is it possible to use this image in my application so that the application can...
4
1774
by: Arthur Dent | last post by:
Hello all... i have a really frsutrating problem here... This is only happening in IE (6 & 7b2), Mozilla and Netscape are both OK. I have a top-level table with a width of 760px, so it should be...
23
2534
by: Dave G | last post by:
Since upgrading one of my clients from A97/W2000 to A2003/XP they have suffered no end of data corruption problems, mainly involving one of the main tables. The corruption can result in one...
0
340
by: Lev Elbert | last post by:
Using DrawImage I draw (in OnPaint) a bitmap on a form protected override void OnPaint(PaintEventArgs e) { if (_album.Count 0) { // Paint the current image Photograph photo =...
1
3467
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
4994
by: mahesh123 | last post by:
Hi Folks, I Want regarding the stretching image on the MDI Form? I have one MDI Form and there is a image on that form? so that i want to stretch the image on the form according to the screen...
0
3566
by: toltmanns | last post by:
I've got this contact form that I created from an existing spry form. Technical Support Form Firefox and Chrome don't have an issue. In IE6, when I try to click into the text field nothing...
0
7224
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
7120
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
7323
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
7380
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...
1
5050
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
4706
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1553
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
415
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.