form size height maximum - 1036 ??

閲覧: 824 回
最初の未読メッセージにスキップ

ian

未読、
2004/03/24 8:59:212004/03/24
To:
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#)


Herfried K. Wagner [MVP]

未読、
2004/03/24 10:57:362004/03/24
To:
* "ian" <ian_mi...@proteria.com> scripsit:

> 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.

Forms must not be larger than the screen.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Stoitcho Goutsev (100) [C# MVP]

未読、
2004/03/25 17:36:472004/03/25
To:
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_mi...@proteria.com> wrote in message
news:OVntFlaE...@TK2MSFTNGP09.phx.gbl...

全員に返信
投稿者に返信
転送
新着メール 0 件