Changing the size of a Windows form to something really large

What is the best way to change the size of a Windows form to something larger? What I mean is, I'd like to create a form in which the size from top to bottom exceeds the size of the currently viewable area, and I'd like scroll bars to appear alongside for scrolling from top to bottom. What is the best manner of doing this?

Thank You,
Ryan Ross
(my brain is fried)
rossryanAsked:
Who is Participating?
 
Jaime OlivaresConnect With a Mentor Software ArchitectCommented:
this can be achieved with the WinAPI's MoveWindow() function, something like:

// will require this at the begining of your file
using System.Runtime.InteropServices;

// put this inside your form declaration
[DllImport("user32")]
public static extern int MoveWindow(IntPtr hwnd, int x, int y, int width, int height, int repaint);

// invoke this from some form's method
MoveWindow(this.Handle,0,0,1000,3000,1);
0
 
Éric MoreauSenior .Net ConsultantCommented:
have you tried the AutoScroll property on the Form?
0
 
MuhammadAdilCommented:
Change AutoScroll property true.
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
MuhammadAdilCommented:
If you have put panels you need to enable AutoScroll property of these panels also.

Regards,
Adil Fazal
0
 
Jaime OlivaresSoftware ArchitectCommented:
Although it is possible using the AutoScroll, it is not recommended. Better you can divide your form into multiple parts and use a TabControl to display your control in pages.
0
 
rossryanAuthor Commented:
Allow me to put it to you this way: when I type in a value for a Height of 3000 for the form, the form refuses to resize to this value. How can I get the form to resize to this value?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.