Re: form size height maximum - 1036 ??
From: Stoitcho Goutsev \(100\) [C# MVP] (100_at_100.com)
Date: 03/25/04
- Next message: SVD: "How To: Create CTRL+V (that strips formatting)"
- Previous message: PocketNerd: "RE: Adding child forms to a form"
- In reply to: ian: "form size height maximum - 1036 ??"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 25 Mar 2004 17:36:47 -0500
Hi ian,
All properties and methods to set the size of the form finally call
SetBondsCore method. This method is declared in the Control class. Control's
implementation doesn't restrict you to set bigger sizes for the control, but
unfrotunately that method is virtual and the Form class overrides it and
add one adjustment of the size when the form is in Normal window state not
to be bigger than SystemInfo.MaxWindowTrackSize.
As long as in C# we cannot call base-base method you cannot skip that
adjustment.
The only thing you can do is to use PInvoke and call say MoveWindows to
chage the size
[DllImport("user32.dll")]
static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int
nHeight, bool bRepaint);
private void button1_Click(object sender, System.EventArgs e)
{
MoveWindow(this.Handle, 0,0, 2000, 2000, true);
//Call UpdateBounds in order form to relayout its controls
this.UpdateBounds();
}
Don't forget to set form's MaximumSize property to some bigger value
-- HTH B\rgds 100 [C# MVP] "ian" <ian_mitchell@proteria.com> wrote in message news:OVntFlaEEHA.2908@TK2MSFTNGP09.phx.gbl... > The system is not letting me increase the size (height) of the form (in the > properties window). > > It lets me reduce the height, but it will not let me set it over 1036. > > I need to set the form size to about 856 x 1100. (The details on the form > are intended to be printed out on A4 paper). > > (I'm wondering if 1036 is the usual height that is used, and that I'm having > problems because I'm trying to print a bit closer to the top & bottom of the > page than usual) > > Does anyone have any suggestions ? > > Thanks, Ian. (C#) > >
- Next message: SVD: "How To: Create CTRL+V (that strips formatting)"
- Previous message: PocketNerd: "RE: Adding child forms to a form"
- In reply to: ian: "form size height maximum - 1036 ??"
- Messages sorted by: [ date ] [ thread ]