473,779 Members | 1,905 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Keep a window within the screen bounds

HaLo2FrEeEk
404 Contributor
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.GetWorki ngArea(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 1232

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

Similar topics

6
1835
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") & "','Today','status=yes,scrollbars=yes,resizable=yes,width=500,height=500')"">" I know there is something wrong with the above, the example I drew from used "/dsn/wwwdomaincom" and I don't know what to do with "dsn" so I am trying to figure out how to make it work without it.
2
2176
by: Pokey | last post by:
What do I put in the javascript code to popup a window full screen? Thxs: Pokey
1
2211
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. After clicking on the thumbnails it shows a bigger picture. I would like to add the function, when clicked on the bigger image it will open a new window showing the picture in a bigger size.
9
12323
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
1223
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
8643
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 the answer was just going to be setting some Keep Together properties to Yes. Alas, it was not to be. It turns out that the report in question is actually a combination of 2 other reports based on different tables. The reports should follow one...
4
2693
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 is the best way to keep the cursor from jumping to another non-visible control when the user tabs past the (currently designated) last control on the form. I've had some luck using the Leave event but the last visible control can change...
3
2022
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 my C# experience is web based and I've never tried this before nor thought of it 'til now as I'm working on my first desktop app. Web searches seem to only show me stupid web browser pop up window code examples. I must not be putting the proper...
4
10541
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 stay on top of EVERYTHING, including outside apps... I just want the windows to stay on top of my main window so that when the user focuses on the main window, the sub windows don't get lost (I don't put them in taskbar)
3
1199
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 confused as to how to make it work. Also, if someone could point out a good reference book, that'd be awesome.
0
9632
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10136
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10071
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9925
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7478
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4036
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3631
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2867
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.