2 // System.Windows.Forms.PrintPreviewControl
5 // stubbed out by Jaak Simm (jaaksimm@firm.ee)
6 // Dennis Hayes (dennish@Raytek.com)
8 // (C) Ximian, Inc., 2002
12 // Permission is hereby granted, free of charge, to any person obtaining
13 // a copy of this software and associated documentation files (the
14 // "Software"), to deal in the Software without restriction, including
15 // without limitation the rights to use, copy, modify, merge, publish,
16 // distribute, sublicense, and/or sell copies of the Software, and to
17 // permit persons to whom the Software is furnished to do so, subject to
18 // the following conditions:
20 // The above copyright notice and this permission notice shall be
21 // included in all copies or substantial portions of the Software.
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
28 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33 using System
.Drawing
.Printing
;
34 using System
.ComponentModel
;
36 namespace System
.Windows
.Forms
{
39 /// The raw "preview" part of print previewing, without any dialogs or buttons. Most PrintPreviewControl objects are found on PrintPreviewDialog objects, but they do not have to be.
44 public class PrintPreviewControl
: Control
{
49 PrintDocument document
;
58 public PrintPreviewControl()
70 public bool AutoZoom
{
71 get { return autoZoom; }
72 set { autoZoom=value; }
76 get { return columns; }
77 set { columns=value; }
81 protected override CreateParams CreateParams
{
83 CreateParams createParams
= base.CreateParams
;
85 createParams
.ClassName
= "PRINTPREVIEWCONTROL";
86 createParams
.Style
= (int) (
87 WindowStyles
.WS_CHILD
|
88 WindowStyles
.WS_VISIBLE
);
94 public PrintDocument Document
{
95 get { return document; }
96 set { document=value; }
104 public int StartPage
{
105 get { return startPage; }
106 set { startPage=value; }
110 public override string Text
{
119 public bool UseAntiAlias
{
120 get { return useAntiAlias; }
121 set { useAntiAlias=value; }
132 public void InvalidatePreview()
138 protected override void OnPaint(PaintEventArgs pevent
)
141 base.OnPaint(pevent
);
145 protected override void OnResize(EventArgs eventargs
)
148 base.OnResize(eventargs
);
152 protected virtual void OnStartPageChanged(EventArgs e
)
158 public override void ResetBackColor()
161 base.ResetBackColor();
165 public override void ResetForeColor()
168 base.ResetForeColor();
172 protected override void WndProc(ref Message m
)
181 public event EventHandler StartPageChanged
;