473,396 Members | 1,783 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,396 software developers and data experts.

Form positionning top left

Hi,

When creating a form, how can we set its property .left and .top to be
handled when the form is showed. Because, if I first assign values to
..left and .top, and secondly I call .show(), then the form does not
display at the correct screen location.

ex:
System.windows.forms.form myForm = new System.windows.forms.form();
myForm.left = 200;
myForm.top = 200;
myForm.show();
//The form does NOT appear at specified screen coordinate.

ex:
System.windows.forms.form myForm = new System.windows.forms.form();
myForm.show();
myForm.left = 200;
myForm.top = 200;
//The form does appear at specified screen coordinate and the user can
see the form's initial position, then reappear to the .left and .top
coordinate.

Any idea?

Thank you,
Marty
Nov 17 '05 #1
2 4791
Here are some things to check:

1. Ensure that the "StartPosition" property of the form is set to "Manual".

2. You didn't say wehre you have this code. If it's in Form_Load and not
working then try placing into the constructor instead.

--
Robert W.
Vancouver, BC
www.mwtech.com

"Marty" wrote:
Hi,

When creating a form, how can we set its property .left and .top to be
handled when the form is showed. Because, if I first assign values to
..left and .top, and secondly I call .show(), then the form does not
display at the correct screen location.

ex:
System.windows.forms.form myForm = new System.windows.forms.form();
myForm.left = 200;
myForm.top = 200;
myForm.show();
//The form does NOT appear at specified screen coordinate.

ex:
System.windows.forms.form myForm = new System.windows.forms.form();
myForm.show();
myForm.left = 200;
myForm.top = 200;
//The form does appear at specified screen coordinate and the user can
see the form's initial position, then reappear to the .left and .top
coordinate.

Any idea?

Thank you,
Marty

Nov 17 '05 #2
Thank you Robert,
the "Manual" worked just fine :)
Marty

Robert W. wrote:
Here are some things to check:

1. Ensure that the "StartPosition" property of the form is set to "Manual".

2. You didn't say wehre you have this code. If it's in Form_Load and not
working then try placing into the constructor instead.

Nov 17 '05 #3

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

Similar topics

2
by: Kiteman - Canada | last post by:
Is there an event triggered when a form is dragged by its titlebar? I have two forms on screen - the main form is draggable and I need the secondary form to automatically reposition itself...
4
by: Eric | last post by:
Hey Everyone.. I have a form that has approximately 7 text fields and 1 checkbox. Generally when this form is submitted(to itself BTW) it works fine, however, when the checkbox is only field...
15
by: seajay | last post by:
Hello, I've designed a website with using any tables, everything is postionned using css, content goes into divs. However I've noticed that the website looks different across browsers. I would...
1
by: Sam | last post by:
Hi, When I load my form my scrollbar is always positionned automatically at the bottom for some reasons... How can I force it to be always at the top? Thx
2
by: Sam | last post by:
Hi, When I load my form my scrollbar is always positionned automatically at the bottom for some reasons... top? I've used user32.dll: Private Const SB_VERT As Integer = 1
1
Chrisjc
by: Chrisjc | last post by:
I am currently working on a form I need a few things from this form. First of all here is the link to what I have so far... ( http://www.triplesource.net/php/Decal%20Offer.html ) And posted below is...
5
by: Sylvain Chevillard | last post by:
Hello. I observed something strange in Firefox which let me study precisely the section 10.3.7 of the specifications of CSS2 and I have a question about it. The specifications refer to a...
6
ak1dnar
by: ak1dnar | last post by:
I have created HTML form and a Java script to validate the form. Here is my requirement. When user select one from any list menu others should set to ALL. Its working here but the problem is we...
2
by: punitshrivastava | last post by:
Hi to All. I am Punit Shrivastava.I am working in Asp.As i am new in this technology please help me. I want to create enquiry form in Asp. For this i code like this: <form name="enquiry"...
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:
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: 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:
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
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
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...

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.