Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / October 2007

Tip: Looking for answers? Try searching our database.

Placing a Form on a particular Screen

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter Oliphant - 25 Oct 2007 02:44 GMT
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==]
Peter Oliphant - 25 Oct 2007 03:00 GMT
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==]

> I'm programming using MS VS VC++ 2008 Express (Beta 2) in /Cli pure mode.
>
[quoted text clipped - 11 lines]
>
> [==Peter==]
Ben Voigt [C++ MVP] - 26 Oct 2007 18:32 GMT
>I might be close to an answer here, but I could use some confirmation.
>
[quoted text clipped - 8 lines]
> 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==]
>
[quoted text clipped - 13 lines]
>>
>> [==Peter==]
Peter Oliphant - 26 Oct 2007 19:10 GMT
Hey Ben,

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

[==Peter==]

>>I might be close to an answer here, but I could use some confirmation.
>>
[quoted text clipped - 44 lines]
>>>
>>> [==Peter==]

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.