How can i open a new form in center of the screen?

B

Benny

Hello Experts,

Currently I am working on a windows application using vs.net 2002.

Assume I have two forms, form A and B, where form A is the main form. In
form A, I have a button which will load form B when click. The question
is how can I open form B in the center of the screen?


Thanks,

Benny

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
A

APG

Hi Benny,

You can use the StartPosition to do that.

Like:

frmB.StartPosition = FormStartPosition.CenterScreen;
frmB.Show();

HTH,
APG
 
S

Supra

in form B look in property window look down to StartPosition and selct
to CentreScreen.
regards
 
B

Benny

Hello APG,

I tried that before, but form B always pop up on the top left corner,
any ideas why?


Thanks,

Benny


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top