473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Keep a window within the screen bounds

HaLo2FrEeEk
404 256MB
This is a continuation of a few of my previous posts, for information on what I'm doing, check out the first paragraph in this post.

I want a way to at least try to keep the screenshot bounds form from going outside the window bounds. I tried creating a rectangle from the screen using Screen.GetWorkingArea(this), then checking if the screenshot bounds rectangle is contained within the screen rectangle, but I ran into a problem. If someone has multiple monitors, GetWorkingArea() is only going to get the bounds of the screen that the program is mostly contained within. If I stop the screenshot bounds form from going outside the screen rectangle, users will never be able to drag the form outside of the screen that it opened up in.

I need a way to make sure that the bounds window isn't being dragged outside the screen bounds, but to also account for odd monitor configurations, like one on top and one to the side, making an "L" shape.

How might I go about doing this?

One idea that I have is doing the check AFTER the resizing/moving is done, check if it's within the current screen's bounds and move/resize it accordingly to make sure it isn't outside. A problem with this is what if someone wants to take a screenshot in between their 2 monitors, or of both the monitors?
Aug 13 '10 #1
0 1214

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: mmac | last post by:
I am trying to create something like this: Response.Write "<a href=""javascript:openWindow('www.domain.com/events/EventDetails.asp?EventID=" & rsEvents("OccID") &...
2
by: Pokey | last post by:
What do I put in the javascript code to popup a window full screen? Thxs: Pokey
1
by: jp | last post by:
bigger image opens in new window within an existing javascript. I am working within a existing javascript. see www.art4companies.nl and press kunstenaars than press any name to see what I mean....
9
by: pow67 | last post by:
Is there a javascript statement which can be incorporated in a hyperlink which will open a new page that fills the screen while leaving the page with the link open? Thanks in advance. CW
1
by: dungping5 | last post by:
Hello, My question is in the following web page: www.pinyinology.com/sortable/table_test.html Thanks. Juli Zhang
6
by: Steve Jorgensen | last post by:
I tried to fix a problem for a client today in which report sections and even individual text controls in some of their reports are being split across page boundaries. Of course, I was thinking...
4
by: BBFrost | last post by:
We have a data entry application written within Framework 1.0 that contains 20+ custom user controls. The controls overlay each other so that only one custom control is visible at a time. What...
3
by: JuLiE Dxer | last post by:
I'm curious about the best way to display a simple popup window when somebody chooses the MenuItem Help>About ... you know, the typical window that pops up describing the application. About 95% of...
4
by: MrNobody | last post by:
I'd like windows spawned off my by main window to always stay above that main window, even when you give focus to it... how would I do this? The only property I find is one which makes that window...
3
by: Dagoberto Aceves | last post by:
Could someone please help? Im trying to figure out how to have multiple forms opened within one form, but the book im using really doesn't help much. I was thinking of using the panels, but im...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.