Click here to Skip to main content
15,918,404 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I've got a user control and when i click on it opens a window. I would like to locaete the window in the same width(X) and above the user control height(y)+10
How do i do that?

Thanks
Posted

if you want to set location change:
public form1()
{
initializecomponent();
}

to

C#
public form1( int x, int y)
{
 initializecomponent();
this.location=new point(x,y);
}


but if you want to change the size just replace:

this.location=new point(x,y);

with

this.size=new size(x,y);

so when you call to open form call it like:
form1 f1=new form1(150,150);
f1.show();
 
Share this answer
 
To sanforjackass,

Hi thanks for your reply.
But:
I dont have property location for my form only form.locationchange -
event?

U understood only half of the quesiton- i want to set the windows location acoording to a user control displayed

Thanks
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900