473,402 Members | 2,053 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,402 software developers and data experts.

Window Positioning

I have an opening form that I want to size to 90% screen width and 90%
screen width, I want to set the location of the top left corner to 5%
values.

Ths size comes out correctly, but on each successive open, the window move
down and left. The positioning/sizing code is shown below.

Any ideas on how to prevent the down and left creep?

Rectangle stScreenDims=Screen.GetBounds(Bounds);
stScreenDims.Location=new Point(stScreenDims.Width/20,
stScreenDims.Height/20);
stScreenDims.Height=stScreenDims.Height*9/10;
stScreenDims.Width=stScreenDims.Width*9/10;

this.Location=stScreenDims.Location;
this.Width=stScreenDims.Width;
this.Height=stScreenDims.Height;

Nov 16 '05 #1
2 1339
Have you set the StartPosition property of the Form to "Manual"?

--
Tim Wilson
..Net Compact Framework MVP

"web1110" <we***@comcast.net> wrote in message
news:Id********************@comcast.com...
I have an opening form that I want to size to 90% screen width and 90%
screen width, I want to set the location of the top left corner to 5%
values.

Ths size comes out correctly, but on each successive open, the window move
down and left. The positioning/sizing code is shown below.

Any ideas on how to prevent the down and left creep?

Rectangle stScreenDims=Screen.GetBounds(Bounds);
stScreenDims.Location=new Point(stScreenDims.Width/20,
stScreenDims.Height/20);
stScreenDims.Height=stScreenDims.Height*9/10;
stScreenDims.Width=stScreenDims.Width*9/10;

this.Location=stScreenDims.Location;
this.Width=stScreenDims.Width;
this.Height=stScreenDims.Height;

Nov 16 '05 #2
Didn't know about that. Thanx

"Tim Wilson" <TIM(UNDERSCORE)WILSON(AT)ROGERS(PERIOD)COM> wrote in message
news:uQ**************@TK2MSFTNGP12.phx.gbl...
Have you set the StartPosition property of the Form to "Manual"?

--
Tim Wilson
.Net Compact Framework MVP

"web1110" <we***@comcast.net> wrote in message
news:Id********************@comcast.com...
I have an opening form that I want to size to 90% screen width and 90%
screen width, I want to set the location of the top left corner to 5%
values.

Ths size comes out correctly, but on each successive open, the window move down and left. The positioning/sizing code is shown below.

Any ideas on how to prevent the down and left creep?

Rectangle stScreenDims=Screen.GetBounds(Bounds);
stScreenDims.Location=new Point(stScreenDims.Width/20,
stScreenDims.Height/20);
stScreenDims.Height=stScreenDims.Height*9/10;
stScreenDims.Width=stScreenDims.Width*9/10;

this.Location=stScreenDims.Location;
this.Width=stScreenDims.Width;
this.Height=stScreenDims.Height;


Nov 16 '05 #3

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

Similar topics

1
by: Noozer | last post by:
When using the WebBrowser control, is it possible to cause popup windows to appear within the WebBrowser control itself instead of a new window? This is what I've written in the NewWindow2 event,...
2
by: Randell D. | last post by:
HELP! Its taken me ages - I'm a newbie and I've compiled bits of code that I've read in this newsgroup over time to create one of my most intricate functions to date... Basically, the script...
9
by: Christopher Benson-Manica | last post by:
In some old Javascript we have, we try to determine whether the client is IE or Netscape (assume for the purposes of this question that the question can be resolved satisfactorily) and tailor the...
2
by: cschang | last post by:
I am not sure this is the right place to ask this question. I have a web page composed with two frames (left and right). Then in my frmae2(right one) , I open a pop-up window by javscript:...
3
by: anonieko | last post by:
You can try this code: > > > > > <!--- filename: mypage.html ----> <html> ....blah blah blah <script language=JavaScript src=/Javascript/center.js></script>
20
by: Geoffrey H. Goldberg | last post by:
I have made a remote control window which opens from its parent. On loading, the remote is positioned relative to the screen using window.moveTo(x,y). What I would like to happen is the remote...
14
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
18
by: Roger Withnell | last post by:
I open a new window from the current window to display maps. Several maps of different sizes can be displayed. The function is given the size of the map and adjusts the window size accordingly....
2
by: Mel | last post by:
I place items at absolute locations on my LONG window. When I scroll the window My Absolute is only relative to the Viewing Area and tends to move up as i scroll my window. Is this the normal...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
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,...
0
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...

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.