Hi
How can i set Currently position of my window form.
for example:

x = this.Location.X;
y = this.Location.Y;

//(x=199, y =200);
//i want to set my windows form in x(10,20)????

Thanks!!

Re: Currently position my windows form by Morten

Morten
Fri Apr 22 06:39:41 CDT 2005

Hi Harry,

I think you need to rephrase your question as I'm not sure what you mean.

You can reposition your form using its Location property

this.Location = new Point(10, 20);

The initial position of your form is controlled by windows unless you specify the StartPosition property to something other than FormStartPosition.WindowsDefaultLocation, for instance FormStartPosition.Manual.

--
Happy coding!
Morten Wennevik [C# MVP]

Re: Currently position my windows form by Peder

Peder
Fri Apr 22 11:25:20 CDT 2005

...and you must set it in your Load event or later, not in the constructor.

- Peder -


Morten Wennevik wrote:
> Hi Harry,
>
> I think you need to rephrase your question as I'm not sure what you mean.
>
> You can reposition your form using its Location property
>
> this.Location = new Point(10, 20);
>
> The initial position of your form is controlled by windows unless you
> specify the StartPosition property to something other than
> FormStartPosition.WindowsDefaultLocation, for instance
> FormStartPosition.Manual.
>

Re: Currently position my windows form by Morten

Morten
Fri Apr 22 12:10:40 CDT 2005

You can set the location in the constructor, but if you are using Visual Studio, beware that Location is set inside InitializeComponent so you need to set it after the call to InitializeComponent.


On Fri, 22 Apr 2005 18:25:20 +0200, Peder Y <pedery@nowhere.com> wrote:

> ...and you must set it in your Load event or later, not in the constructor.
>
> - Peder -
>
>
> Morten Wennevik wrote:
>> Hi Harry,
>>
>> I think you need to rephrase your question as I'm not sure what you mean.
>>
>> You can reposition your form using its Location property
>>
>> this.Location = new Point(10, 20);
>>
>> The initial position of your form is controlled by windows unless you
>> specify the StartPosition property to something other than
>> FormStartPosition.WindowsDefaultLocation, for instance
>> FormStartPosition.Manual.
>>
>



--
Happy coding!
Morten Wennevik [C# MVP]