473,394 Members | 1,759 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.

Setting initial Form location

I've tried to set up a Form location via its constructor in the following
way (My_Form is derived as a child of the standard Form):

My_Form( int x, int y, int w, int h )
{
Rectangle rect( x, y, w, h ) ;
this->Bounds = rect ;
} ;

When I do this the width and height are properly set, but it doesn't place
in proper (x,y) location. I've also tried setting up Width, Height, Top, and
Left independently, and again, width and height work but not the location.
Why? And what SHOULD I do to setup (x,y) prior to ShowDialog()?
Nov 17 '05 #1
2 1240
PS - If I read the form's Top and Left properties they SAY it's in the
location I said to put the form, but it obviously is NOT at that location on
the screen! (I've also tried the Location property). Is it possible you
CAN'T set up its location in a constructor?

BTW, I forgot to mention that I also call the Form() default constructor
ala:

My_Form( int x, int y, int w, int h ) : Form() // <= Form constructor
{
Rectangle rect( x, y, w, h ) ;
this->Bounds = rect ;
} ;
"Peter Oliphant" <po*******@RoundTripInc.com> wrote in message
news:uF**************@TK2MSFTNGP11.phx.gbl...
I've tried to set up a Form location via its constructor in the following
way (My_Form is derived as a child of the standard Form):

My_Form( int x, int y, int w, int h )
{
Rectangle rect( x, y, w, h ) ;
this->Bounds = rect ;
} ;

When I do this the width and height are properly set, but it doesn't place
in proper (x,y) location. I've also tried setting up Width, Height, Top,
and Left independently, and again, width and height work but not the
location. Why? And what SHOULD I do to setup (x,y) prior to ShowDialog()?

Nov 17 '05 #2
Got it, I had to set StartPosition to Manual.... :)

"Peter Oliphant" <po*******@RoundTripInc.com> wrote in message
news:OH**************@TK2MSFTNGP09.phx.gbl...
PS - If I read the form's Top and Left properties they SAY it's in the
location I said to put the form, but it obviously is NOT at that location
on the screen! (I've also tried the Location property). Is it possible you
CAN'T set up its location in a constructor?

BTW, I forgot to mention that I also call the Form() default constructor
ala:

My_Form( int x, int y, int w, int h ) : Form() // <= Form constructor
{
Rectangle rect( x, y, w, h ) ;
this->Bounds = rect ;
} ;
"Peter Oliphant" <po*******@RoundTripInc.com> wrote in message
news:uF**************@TK2MSFTNGP11.phx.gbl...
I've tried to set up a Form location via its constructor in the following
way (My_Form is derived as a child of the standard Form):

My_Form( int x, int y, int w, int h )
{
Rectangle rect( x, y, w, h ) ;
this->Bounds = rect ;
} ;

When I do this the width and height are properly set, but it doesn't
place in proper (x,y) location. I've also tried setting up Width, Height,
Top, and Left independently, and again, width and height work but not the
location. Why? And what SHOULD I do to setup (x,y) prior to ShowDialog()?


Nov 17 '05 #3

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

Similar topics

2
by: bagsmode | last post by:
Hi, I'm trying to set a session cookie and then redirect, however I get the error: Status: 302 Moved Location: /index.cgi I thought I recall getting an error like this when I first tried...
21
by: | last post by:
Hi, I am setting the NumericUpDown .Value property and the ValueChanged event is NOT being fired. Does this ONLY get fired when I change it on the UI and not programatically? Thanks
12
by: daniel kaplan | last post by:
Hi All, Been learning Javascript (via google) to create forms with pre-set values. As seen below. My problem I have found is this: I can't seem to figure out (or find so far via google) how to...
1
by: G Uljee | last post by:
Hi all, I've some difficulties with the screen/form locations. When I fist set my location of the form and then the execute the show command the form is located at...
3
by: countd4 | last post by:
I have built a working user control. However, to make it work, I always have to set certian properties using the properties sheet for the control when using it on other forms. I want to be able to...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
5
by: Finn Stampe Mikkelsen | last post by:
Hi How can i set a focus to a textbox in my codebehind page?? I have this WebForm, that takes information from a user and 2 buttons on the form. One that takes action on the entered...
8
by: Andrus | last post by:
..NET 2 Winforms application. How to create new setting and set it default value in userSettings section of app.config file or overwrite existing setting value ? I found code below in this list...
1
by: =?Utf-8?B?UmljaA==?= | last post by:
I placed a button on a form menustrip for the purpose of causing the horizontal scrollbar of my form to appear so that I can access controls outside of the form's current view (the controls are...
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
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
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
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
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...

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.