By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,733 Members | 845 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,733 IT Pros & Developers. It's quick & easy.

Placing a Form on a particular Screen

P: n/a
I'm programming using MS VS VC++ 2008 Express (Beta 2) in /Cli pure mode.

I've found the Screen class. With it I can very easily get the count and all
the data on the various Screens attached to a system, whether it be a single
screen or multiple screen system.

I believe the FromControl method of the Screen class can be used to
determine which Screen a Form is on. But I can't find how I can place or
move a Form onto the Screen of my choice (in code).

I looked in MSDN2.com. I can't find a Screen property in the Form class. I
can't find something like a Form's list or an AddForm method in Screen. So I
need help.

[==Peter==]

Oct 25 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I might be close to an answer here, but I could use some confirmation.

There is something called workingArea in the Screen class. I noticed in it
that my right-screen is listed as having a Left and Right value
corresponding to values as if it is an extension of my left-screen i.e., the
right-screen Left equals the left-screen's Right, and the left-screen's
Right is equal to the sum of the two screen's widths).

So, does this mean if a Form is on the right-screen and I give it NEGATIVE X
coordinates it will appear on the left-screen? Or that if a Form is on the
left-screen and I give large enough X coordinates it will start to appear on
the right-screen?

If this is true, that means a form can be logically on one screen and
visually on the other? That seems wrong somehow...

Am I totally off base here?

[==Peter==]

"Peter Oliphant" <pe********@hotmail.comwrote in message
news:1E**********************************@microsof t.com...
I'm programming using MS VS VC++ 2008 Express (Beta 2) in /Cli pure mode.

I've found the Screen class. With it I can very easily get the count and
all the data on the various Screens attached to a system, whether it be a
single screen or multiple screen system.

I believe the FromControl method of the Screen class can be used to
determine which Screen a Form is on. But I can't find how I can place or
move a Form onto the Screen of my choice (in code).

I looked in MSDN2.com. I can't find a Screen property in the Form class. I
can't find something like a Form's list or an AddForm method in Screen. So
I need help.

[==Peter==]
Oct 25 '07 #2

P: n/a

"Peter Oliphant" <pe********@hotmail.comwrote in message
news:57**********************************@microsof t.com...
>I might be close to an answer here, but I could use some confirmation.

There is something called workingArea in the Screen class. I noticed in it
that my right-screen is listed as having a Left and Right value
corresponding to values as if it is an extension of my left-screen i.e.,
the right-screen Left equals the left-screen's Right, and the
left-screen's Right is equal to the sum of the two screen's widths).

So, does this mean if a Form is on the right-screen and I give it NEGATIVE
X coordinates it will appear on the left-screen? Or that if a Form is on
the left-screen and I give large enough X coordinates it will start to
appear on the right-screen?
Yes.
>
If this is true, that means a form can be logically on one screen and
visually on the other? That seems wrong somehow...

Am I totally off base here?
Well, sort of. There is no "logically on one screen". There is a single
coordinate system in which all screens are placed.

If the left screen starts at X=0, and the right screen starts at X=1024,
then if the Form is one the right screen it will have X >= 1024. To move to
the left screen (or spanning the gap) you'd set X < 1024, not negative X.

Hope this is what you needed to know.
>
[==Peter==]

"Peter Oliphant" <pe********@hotmail.comwrote in message
news:1E**********************************@microsof t.com...
>I'm programming using MS VS VC++ 2008 Express (Beta 2) in /Cli pure mode.

I've found the Screen class. With it I can very easily get the count and
all the data on the various Screens attached to a system, whether it be a
single screen or multiple screen system.

I believe the FromControl method of the Screen class can be used to
determine which Screen a Form is on. But I can't find how I can place or
move a Form onto the Screen of my choice (in code).

I looked in MSDN2.com. I can't find a Screen property in the Form class.
I can't find something like a Form's list or an AddForm method in Screen.
So I need help.

[==Peter==]
Oct 26 '07 #3

P: n/a
Hey Ben,

Yup! Just wanted to be sure before I wrote a lot of code. Thanx again!!!
: )

[==Peter==]

"Ben Voigt [C++ MVP]" <rb*@nospam.nospamwrote in message
news:7F**********************************@microsof t.com...
>
"Peter Oliphant" <pe********@hotmail.comwrote in message
news:57**********************************@microsof t.com...
>>I might be close to an answer here, but I could use some confirmation.

There is something called workingArea in the Screen class. I noticed in
it that my right-screen is listed as having a Left and Right value
corresponding to values as if it is an extension of my left-screen i.e.,
the right-screen Left equals the left-screen's Right, and the
left-screen's Right is equal to the sum of the two screen's widths).

So, does this mean if a Form is on the right-screen and I give it
NEGATIVE X coordinates it will appear on the left-screen? Or that if a
Form is on the left-screen and I give large enough X coordinates it will
start to appear on the right-screen?

Yes.
>>
If this is true, that means a form can be logically on one screen and
visually on the other? That seems wrong somehow...

Am I totally off base here?

Well, sort of. There is no "logically on one screen". There is a single
coordinate system in which all screens are placed.

If the left screen starts at X=0, and the right screen starts at X=1024,
then if the Form is one the right screen it will have X >= 1024. To move
to the left screen (or spanning the gap) you'd set X < 1024, not negative
X.

Hope this is what you needed to know.
>>
[==Peter==]

"Peter Oliphant" <pe********@hotmail.comwrote in message
news:1E**********************************@microso ft.com...
>>I'm programming using MS VS VC++ 2008 Express (Beta 2) in /Cli pure
mode.

I've found the Screen class. With it I can very easily get the count and
all the data on the various Screens attached to a system, whether it be
a single screen or multiple screen system.

I believe the FromControl method of the Screen class can be used to
determine which Screen a Form is on. But I can't find how I can place or
move a Form onto the Screen of my choice (in code).

I looked in MSDN2.com. I can't find a Screen property in the Form class.
I can't find something like a Form's list or an AddForm method in
Screen. So I need help.

[==Peter==]

Oct 26 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.