Jarod Posted February 12, 2003 Posted February 12, 2003 I have seen that Visual Studio.NET refuse to create (at design time) forms that are bigger than the resolution screen. It is the same at runtime And increasing the screen resolution will allow the creation of bigger forms. However I wonder if there is a .NET limitation to forms size. Any Idea? Thanks, Quote Jarod
Machaira Posted February 12, 2003 Posted February 12, 2003 I was able to set the Size of a form to slightly larger than my screen res (12 pixels both ways), which is strange. Quote Here's what I'm up to.
*Experts* Volte Posted February 12, 2003 *Experts* Posted February 12, 2003 It's probably not taking into account the form borders or something. Anyway, why would you want to set the form larger than the screen? That can't be a very good idea for a regular application, anyway. :-\ Still, it doesn't look like you can do it with .NET alone. You might be able to do it with API. Try looking at the [api]SetWindowPos[/api] API. Quote
Jarod Posted February 12, 2003 Author Posted February 12, 2003 What I want to do is to create a form of size 2048x768. The client will lhave a PC with two screens used as a single one (multiscreen system). So, I would like to be able to create my form of that size and design it correctly, without having such a resolution on my development computer... Quote Jarod
TechnoTone Posted February 12, 2003 Posted February 12, 2003 Can you not design the form so that it is resizable. That way you can develop it at your resolution but the client can increase the form to fit their 2048x768 desktop. This will also make it flexible enough to work with other resolutions too. Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
*Experts* Volte Posted February 12, 2003 *Experts* Posted February 12, 2003 My computer has two monitors, and it does allow me to resize it larger than my main monitor. If I set the width and height to 8000x8000, then it goes just a little bit lower than the screen, and it fills up both monitors. It just won't go bigger than both monitors combined. Quote
Heiko Posted June 3, 2003 Posted June 3, 2003 Maybe a related question: I have a custom user control for entering DateTime Values. This user control contrains a button which will popup a new form (modal) with a calendar on it. The position of the new "calendar-form" is determined via the position of the caller (my user control). Now I'd like to be able to compute, whether the popup calendar will be "on the screen". I know the logic - but I don't know how I can detect the relation the actual screen size. Any ideas? Quote .nerd
Heiko Posted June 4, 2003 Posted June 4, 2003 ok. problem solved. Public Shared Sub EnsureOnScreen(ByRef aControl As Control) Dim mainLeft As Integer Dim mainRight As Integer Dim mainTop As Integer Dim mainBottom As Integer Dim formLeft As Integer Dim formRight As Integer Dim formTop As Integer Dim formBottom As Integer Dim moveLeft As Integer Dim moveRight As Integer Dim moveUp As Integer Dim moveDown As Integer Dim upperLeft As Point Dim lowerRight As Point upperLeft = aControl.PointToScreen(New Point(0, 0)) lowerRight = aControl.PointToScreen(New Point(aControl.Width, aControl.Height)) formLeft = upperLeft.X formTop = upperLeft.Y formRight = lowerRight.X formBottom = lowerRight.Y mainLeft = 0 mainTop = 0 mainBottom = Screen.PrimaryScreen.Bounds.Bottom mainRight = Screen.PrimaryScreen.Bounds.Width If formLeft < mainLeft Then moveRight = mainLeft - formLeft End If If formRight > mainRight Then moveLeft = formRight - mainRight End If If formTop < mainTop Then moveDown = mainTop - formTop End If If formBottom > mainBottom Then moveUp = formBottom - mainBottom End If upperLeft = aControl.Location upperLeft.X = upperLeft.X - moveLeft + moveRight upperLeft.Y = upperLeft.Y + moveDown - moveUp aControl.Location = upperLeft End Sub I know. Lengthy code. But easy to grasp. Quote .nerd
*Gurus* divil Posted June 4, 2003 *Gurus* Posted June 4, 2003 Alternatively: Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim primaryBounds As Rectangle = Screen.PrimaryScreen.WorkingArea Dim formBounds As Rectangle = Me.Bounds If Not primaryBounds.Contains(formBounds) Then Bounds = Rectangle.Intersect(primaryBounds, formBounds) End If End Sub This will also take accound of the taskbar space :) Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.