0

I'm trying to create a window (Borderless, if that matters) that is quite wide (9000+ px) and for some reason, no matter what I try, it's always being limited down to exactly 1932px. I've heard that this is a default limit put in place by Visual Studio.

The window is to be put inside a split container.

Even though I've tried changing form.MaximumSize it's still bumping it down to 1932px. How can I remove this limit?

  • 9000? why do u want that much width? – syed mohsin Aug 14 '13 at 15:05
  • 1
    You told us what you're doing, but you haven't told us what problem you're trying to solve; [why](http://meta.stackexchange.com/questions/66377/) are you trying to create a window 9000+ px wide? What if your monitor can't display that, and windows contain containers, not the other way around, so even if you succeeded I don't understand what you are trying to accomplish. – Dour High Arch Aug 14 '13 at 15:07
  • It's not a default of any kind. It's sizing by available screen (resolution). Is this a duplicate: http://stackoverflow.com/questions/6651115/is-the-size-of-a-form-in-visual-studio-designer-limited-to-screen-resolution? – DonBoitnott Aug 14 '13 at 15:08
  • There's also good information here: http://social.msdn.microsoft.com/Forums/vstudio/en-US/60e3b413-7746-46d4-8351-0c7f4e38378f/does-form-size-has-any-limitation-like-maximum-width-or-maximum-height. But Dour is right...what in the world are you doing?! – DonBoitnott Aug 14 '13 at 15:09
  • I'm not sure how the reasoning behind creating a window that large is important, just that I need it to happen. I'm trying to place it inside a parent form so that you can scroll along the entire contents of the larger window. Thanks for the link Don, that really helped explain it! Is there any news on if you can override the `.SetBoundsCore`? –  Aug 14 '13 at 16:10
  • I don't believe so. The one post suggested perhaps it was coming, but I don't know of it if they did. BTW: advice is part of the deal here. Oftentimes, we get locked into ideas that aren't so great. Having someone question your motives is not a bad thing...it forces you to explain it which = thinking harder. Never a bad deal. – DonBoitnott Aug 14 '13 at 16:12
  • A Form class will always behave like a form, even if you set its TopLevel property to false. Limiting its size to the size of the screen is hard-coded behavior that you cannot change. The sane thing to do here is to use a UserControl instead. – Hans Passant Aug 14 '13 at 18:28
  • @HansPassant it's strange that changing the `Size` (by code) seems unable to make it larger than the screen size. However if we use mouse to resize the form at runtime, we can resize it to a fairly large size (about 6 times wider than the screen width). I've tried it (with some `MouseDown` and `MouseMove` event handlers to be able to move form by holding mouse down on the client area and drag). That means we may have some way to make it larger than the screen using code? – King King Aug 14 '13 at 19:08

0 Answers0