|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace VVX
{
/// <summary>
/// Form for obtaining the print options
/// </summary>
public partial class PrintOptions : Form
{
#region Constructors
/// <summary>
/// Constructor
/// </summary>
public PrintOptions()
{
InitializeComponent();
}
/// <summary>
/// Constructor with list of fields to display
/// </summary>
/// <param name="availableFields">list of fields</param>
public PrintOptions(List<string> availableFields)
{
InitializeComponent();
foreach (string column in availableFields)
{
ctlColumnsToPrintCHKLBX.Items.Add(column, true);
}
}
#endregion //Constructors
#region Event Handlers
private void OnLoadForm(object sender, EventArgs e)
{
// Initialize some controls
ctlPrintAllRowsRBTN.Checked = true;
ctlPrintToFitPageWidthCHK.Checked = true;
}
private void btnOK_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.OK;
this.Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
#endregion //Event Handlers
/// <summary>
/// Returns list of columns selected for printing
/// </summary>
/// <returns></returns>
public List<string> GetSelectedColumns()
{
List<string> list = new List<string>();
foreach (object item in ctlColumnsToPrintCHKLBX.CheckedItems)
{
list.Add(item.ToString());
}
return list;
}
#region Properties
/// <summary>
/// Set or Get Title for the printed output
/// </summary>
public string PrintTitle
{
get { return ctlPrintTitleTBX.Text; }
set { ctlPrintTitleTBX.Text = value; }
}
/// <summary>
/// Returns 'true' if all rows have to be printed
/// </summary>
public bool PrintAllRows
{
get { return ctlPrintAllRowsRBTN.Checked; }
}
/// <summary>
/// Returns 'true' if all columns have to fit into the width of the page
/// </summary>
public bool FitToPageWidth
{
get { return ctlPrintToFitPageWidthCHK.Checked; }
}
#endregion //Properties
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.