Class DialogPage
Represents the special kind of report page that wraps the System.Windows.Forms.Form and used to display dialog forms.
Inheritance
Inherited Members
Namespace: FastReport.Dialog
Assembly: FastReport.dll
Syntax
public class DialogPage : PageBase, IComponent, IDisposable, IFRSerializable, IParent
Remarks
Use the Controls property to add/remove controls to/from a dialog form.
If you set the Visible property to false, this dialog form will be skippen when you run a report.
Examples
This example shows how to create a dialog form with one button in code.
DialogPage form = new DialogPage();
// set the width and height in pixels
form.Width = 200;
form.Height = 200;
form.Name = "Form1";
// create a button
ButtonControl button = new ButtonControl();
button.Location = new Point(20, 20);
button.Size = new Size(75, 25);
button.Text = "The button";
// add the button to the form
form.Controls.Add(button);
Constructors
DialogPage()
Initializes a new instance of the DialogPage class.
Declaration
public DialogPage()
Properties
AcceptButton
Gets or sets the button on the form that is clicked when the user presses the ENTER key. Wraps the System.Windows.Forms.Form.AcceptButton property.
Declaration
[TypeConverter(typeof(ComponentRefConverter))]
public ButtonControl AcceptButton { get; set; }
Property Value
Type | Description |
---|---|
ButtonControl |
ActiveInWeb
Gets or sets an active state in Web application.
Declaration
[Browsable(false)]
public bool ActiveInWeb { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
AutoScaleDimensions
Gets the auto scale dimensions for this form.
Declaration
public SizeF AutoScaleDimensions { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.SizeF |
BackColor
Gets or sets the background color for the form. Wraps the System.Windows.Forms.Form.BackColor property.
Declaration
public Color BackColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color |
CancelButton
Gets or sets the button control that is clicked when the user presses the ESC key. Wraps the System.Windows.Forms.Form.CancelButton property.
Declaration
[TypeConverter(typeof(ComponentRefConverter))]
public ButtonControl CancelButton { get; set; }
Property Value
Type | Description |
---|---|
ButtonControl |
ClientSize
Gets or sets the size of client area of the object.
Declaration
public override SizeF ClientSize { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.SizeF |
Overrides
Remarks
This property is used in the
Controls
Gets the collection of controls contained within the form.
Declaration
[Browsable(false)]
public DialogComponentCollection Controls { get; }
Property Value
Type | Description |
---|---|
DialogComponentCollection |
Font
Gets or sets the font of the text displayed by the control. Wraps the System.Windows.Forms.Control.Font property.
Declaration
public Font Font { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Font |
Form
Gets an internal Form.
Declaration
[Browsable(false)]
public BaseForm Form { get; }
Property Value
Type | Description |
---|---|
BaseForm |
FormBorderStyle
Gets or sets the border style of the form. Wraps the System.Windows.Forms.Form.FormBorderStyle property.
Declaration
public FormBorderStyle FormBorderStyle { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.FormBorderStyle |
FormClosedEvent
Gets or sets a script method name that will be used to handle the FormClosed event.
Declaration
public string FormClosedEvent { get; set; }
Property Value
Type | Description |
---|---|
System.String |
FormClosingEvent
Gets or sets a script method name that will be used to handle the FormClosing event.
Declaration
public string FormClosingEvent { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Height
Gets or sets the height of the object.
Declaration
public override float Height { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Overrides
Remarks
This property value is measured in the screen pixels. Use Units class to convert a value to desired units.
Left
Gets or sets the left coordinate of the object in relation to its container.
Declaration
[Browsable(false)]
public override float Left { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Overrides
Remarks
This property value is measured in the screen pixels. Use Units class to convert a value to desired units.
To obtain absolute coordinate, use AbsLeft property.
LoadEvent
Gets or sets a script method name that will be used to handle the Load event.
Declaration
public string LoadEvent { get; set; }
Property Value
Type | Description |
---|---|
System.String |
PaintEvent
Gets or sets a script method name that will be used to handle the Paint event.
Declaration
public string PaintEvent { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ResizeEvent
Gets or sets a script method name that will be used to handle the Resize event.
Declaration
public string ResizeEvent { get; set; }
Property Value
Type | Description |
---|---|
System.String |
RightToLeft
Gets or sets a value indicating whether control's elements are aligned to support locales using right-to-left fonts. Wraps the System.Windows.Forms.Control.RightToLeft property.
Declaration
public RightToLeft RightToLeft { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.RightToLeft |
ShownEvent
Gets or sets a script method name that will be used to handle the Shown event.
Declaration
public string ShownEvent { get; set; }
Property Value
Type | Description |
---|---|
System.String |
SnapSize
Gets the snap size for this page.
Declaration
public override SizeF SnapSize { get; }
Property Value
Type | Description |
---|---|
System.Drawing.SizeF |
Overrides
Text
Gets or sets the text associated with this form. Wraps the System.Windows.Forms.Form.Text property.
Declaration
public string Text { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Top
Gets or sets the top coordinate of the object in relation to its container.
Declaration
[Browsable(false)]
public override float Top { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Overrides
Remarks
This property value is measured in the screen pixels. Use Units class to convert a value to desired units.
To obtain absolute coordinate, use AbsTop property.
Width
Gets or sets the width of the object.
Declaration
public override float Width { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Overrides
Remarks
This property value is measured in the screen pixels. Use Units class to convert a value to desired units.
Methods
AddChild(Base)
Adds a child object to this object's childs.
Declaration
public virtual void AddChild(Base child)
Parameters
Type | Name | Description |
---|---|---|
Base | child | Object to add. |
Assign(Base)
Copies the contents of another, similar object.
Declaration
public override void Assign(Base source)
Parameters
Type | Name | Description |
---|---|---|
Base | source | Source object to copy the contents from. |
Overrides
Remarks
Call Assign to copy the properties from another object of the same type. The standard form of a call to Assign is
destination.Assign(source);
which tells the destination object to copy the contents of the source object to itself. In this method, all child objects are ignored. If you want to copy child objects, use the AssignAll method.
See Also
CanContain(Base)
Gets a value indicating that this object can contain the specified child object.
Declaration
public virtual bool CanContain(Base child)
Parameters
Type | Name | Description |
---|---|---|
Base | child | Child object. |
Returns
Type | Description |
---|---|
System.Boolean | true if this object can contain the specified child object; otherwise, false. |
Deserialize(FRReader)
Deserializes the object.
Declaration
public override void Deserialize(FRReader reader)
Parameters
Type | Name | Description |
---|---|---|
FRReader | reader | Reader object. |
Overrides
Remarks
Do not call this method directly. You should override it if you are developing a new component for FastReport.
This method is called when the object needs to restore the state. It may happen when:
- loading the report from a file or stream;
- loading the report from the designer's undo buffer;
- assigning another object to this object using the Assign(Base) or AssignAll methods;
- loading the object from the designer's clipboard;
- loading the object from the preview pages.
Dispose(Boolean)
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Overrides
DrawSelection(FRPaintEventArgs)
Draw the selection points.
Declaration
public override void DrawSelection(FRPaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
FRPaintEventArgs | e | Paint event args. |
Overrides
Remarks
This method draws a set of selection points returned by the FastReport.ComponentBase.GetSelectionPoints() method.
GetChildObjects(ObjectCollection)
Gets a list of child objects.
Declaration
public virtual void GetChildObjects(ObjectCollection list)
Parameters
Type | Name | Description |
---|---|---|
ObjectCollection | list | List to fill with values. |
GetChildOrder(Base)
Returns z-order of the specified child object.
Declaration
public virtual int GetChildOrder(Base child)
Parameters
Type | Name | Description |
---|---|---|
Base | child | Child object. |
Returns
Type | Description |
---|---|
System.Int32 | Z-order of the specified object. |
Remarks
This method must return the index of a specified child object in the internal child list.
GetContextMenu()
Gets the object's context menu.
Declaration
public override ContextMenuBase GetContextMenu()
Returns
Type | Description |
---|---|
ContextMenuBase | Null reference if object does not have a menu. |
Overrides
Remarks
Do not call this method directly. You may override it if you are developing a new component for FastReport.
You may use base menu classes such as ComponentBaseMenu, ReportComponentBaseMenu to create own context menus.
GetPageDesignerType()
Gets a page designer for this page type.
Declaration
public override Type GetPageDesignerType()
Returns
Type | Description |
---|---|
System.Type | The page designer. |
Overrides
GetSelectionPoints()
Gets the object's selection points.
Declaration
protected override SelectionPoint[] GetSelectionPoints()
Returns
Type | Description |
---|---|
SelectionPoint[] | Array of SelectionPoint objects. |
Overrides
Remarks
Selection point is a small square displayed at the object's sides when object is selected in the designer. You can drag this square by the mouse to change the object's size. For example, the TextObject has eight selection points to change its width and height by the mouse.
If you are developing a new component for FastReport, you may override this method if your object has non-standard set of selection points. For example, if an object has something like "AutoSize" property, it would be good to disable all selection points if that property is true, to disable resizing of the object by the mouse.
HandleDoubleClick()
Handles double click event in the designer.
Declaration
public override void HandleDoubleClick()
Overrides
Remarks
This method is called when the user doubleclicks the object in the designer. Typical implementation invokes the object's editor (calls the InvokeEditor method) and sets the designer's Modified flag.
HandleMouseDown(FRMouseEventArgs)
Handles MouseDown event that occurs when the user clicks the mouse in the designer.
Declaration
public override void HandleMouseDown(FRMouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
FRMouseEventArgs | e | Current mouse state. |
Overrides
Remarks
This method is called when the user press the mouse button in the designer. The standard implementation does the following:
- checks if the mouse pointer is inside the object;
- add an object to the selected objects list of the designer;
- sets the e.Handled flag to true.
HandleMouseHover(FRMouseEventArgs)
Handles MouseMove event that occurs when the user moves the mouse in the designer.
Declaration
public override void HandleMouseHover(FRMouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
FRMouseEventArgs | e | Current mouse state. |
Overrides
Remarks
This method is called when the user moves the mouse in the designer. Typical use of this method is to change the mouse cursor to SizeAll when it is over an object. The standard implementation does the following:
- checks if the mouse pointer is inside the object;
- changes the cursor shape (e.Cursor property);
- sets the e.Handled flag to true.
HandleMouseUp(FRMouseEventArgs)
Handles MouseUp event that occurs when the user releases the mouse button in the designer.
Declaration
public override void HandleMouseUp(FRMouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
FRMouseEventArgs | e | Current mouse state. |
Overrides
Remarks
This method is called when the user releases the mouse button in the designer. The standard implementation does the following:
- if e.Mode is WorkspaceMode2.SelectionRect, checks if object is inside the selection rectangle and sets e.Handled flag if so;
- checks that object is inside its parent (calls the FastReport.ComponentBase.CheckParent(System.Boolean) method).
OnFormClosed(FormClosedEventArgs)
This method fires the FormClosed event and the script code connected to the FormClosedEvent.
Declaration
public void OnFormClosed(FormClosedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.FormClosedEventArgs | e | Event data. |
OnFormClosing(FormClosingEventArgs)
This method fires the FormClosing event and the script code connected to the FormClosingEvent.
Declaration
public void OnFormClosing(FormClosingEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.FormClosingEventArgs | e | Event data. |
OnLoad(EventArgs)
This method fires the Load event and the script code connected to the LoadEvent.
Declaration
public void OnLoad(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | Event data. |
OnPaint(PaintEventArgs)
This method fires the Paint event and the script code connected to the PaintEvent.
Declaration
public void OnPaint(PaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.PaintEventArgs | e | Event data. |
OnResize(EventArgs)
This method fires the Resize event and the script code connected to the ResizeEvent.
Declaration
public void OnResize(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | Event data. |
OnShown(EventArgs)
This method fires the Shown event and the script code connected to the ShownEvent.
Declaration
public void OnShown(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | Event data. |
RemoveChild(Base)
Removes a specified object from this object's childs.
Declaration
public virtual void RemoveChild(Base child)
Parameters
Type | Name | Description |
---|---|---|
Base | child |
Serialize(FRWriter)
Serializes the object.
Declaration
public override void Serialize(FRWriter writer)
Parameters
Type | Name | Description |
---|---|---|
FRWriter | writer | Writer object. |
Overrides
Remarks
Do not call this method directly. You should override it if you are developing a new component for FastReport.
This method is called when the object needs to save the state. It may happen when:
- saving the report to the file or stream;
- saving the report to the designer's undo buffer;
- assigning the object to another object using the Assign(Base) or AssignAll methods;
- saving the object to the designer's clipboard;
- saving the object to the preview (when run a report).
SetChildOrder(Base, Int32)
Sets the z-order of the specified object.
Declaration
public virtual void SetChildOrder(Base child, int order)
Parameters
Type | Name | Description |
---|---|---|
Base | child | Child object. |
System.Int32 | order | New Z-order. |
Remarks
This method must place the specified child object at the specified position in the internal child list.
SetDefaults()
This method is called by the designer when you create a new page.
Declaration
public override void SetDefaults()
Overrides
Remarks
You may create the default page layout (add default bands, set default page size, etc).
ShowDialog()
Shows the form as a modal dialog box with the currently active window set as its owner. Wraps the System.Windows.Forms.Form.ShowDialog method.
Declaration
public DialogResult ShowDialog()
Returns
Type | Description |
---|---|
System.Windows.Forms.DialogResult | One of the DialogResult values. |
ShowDialogAsync()
Shows the form as a modal dialog box with the currently active window set as its owner. Wraps the System.Windows.Forms.Form.ShowDialog method. Uses async call to ShowDialog if possible.
Declaration
public async Task<DialogResult> ShowDialogAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Windows.Forms.DialogResult> | One of the DialogResult values. |
UpdateLayout(Single, Single)
Updates the children layout when the size of this object is changed by dx, dy values.
Declaration
public virtual void UpdateLayout(float dx, float dy)
Parameters
Type | Name | Description |
---|---|---|
System.Single | dx | X delta. |
System.Single | dy | Y delta. |
Remarks
This method must update positions/sizes of child objects whose Dock or Anchor properties are set to non-default values.
Events
FormClosed
Occurs after the form is closed. Wraps the System.Windows.Forms.Form.FormClosed event.
Declaration
public event FormClosedEventHandler FormClosed
Event Type
Type | Description |
---|---|
System.Windows.Forms.FormClosedEventHandler |
FormClosing
Occurs before the form is closed. Wraps the System.Windows.Forms.Form.FormClosing event.
Declaration
public event FormClosingEventHandler FormClosing
Event Type
Type | Description |
---|---|
System.Windows.Forms.FormClosingEventHandler |
Load
Occurs before a form is displayed for the first time. Wraps the System.Windows.Forms.Form.Load event.
Declaration
public event EventHandler Load
Event Type
Type | Description |
---|---|
System.EventHandler |
Paint
Occurs when the form is redrawn. Wraps the System.Windows.Forms.Control.Paint event.
Declaration
public event PaintEventHandler Paint
Event Type
Type | Description |
---|---|
System.Windows.Forms.PaintEventHandler |
Resize
Occurs when the form is resized. Wraps the System.Windows.Forms.Control.Resize event.
Declaration
public event EventHandler Resize
Event Type
Type | Description |
---|---|
System.EventHandler |
Shown
Occurs whenever the form is first displayed. Wraps the System.Windows.Forms.Form.Shown event.
Declaration
public event EventHandler Shown
Event Type
Type | Description |
---|---|
System.EventHandler |