Solved

Changing the size of a Windows form to something really large

Posted on 2008-06-12
8
229 Views
Last Modified: 2010-04-15
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)
0
Comment
Question by:rossryan
8 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 21768900
have you tried the AutoScroll property on the Form?
0
 
LVL 6

Expert Comment

by:MuhammadAdil
ID: 21769006
Change AutoScroll property true.
0
 
LVL 6

Expert Comment

by:MuhammadAdil
ID: 21769024
If you have put panels you need to enable AutoScroll property of these panels also.

Regards,
Adil Fazal
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 21771818
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
 

Author Comment

by:rossryan
ID: 21773488
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
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 250 total points
ID: 21773611
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

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now