Hi Simon,
You would have to derive the PrintPreviewDialog form and add the checkbox to the toolbar control of the PrintPreViewDialog in the constructor method. Please refer to attached sample for more details.
public class AdvPrintPreView : PrintPreviewDialog
{
private void InitializeComponent()
{
this.ClientSize = new System.Drawing.Size(600, 600);
this.Name = "AdvPrintPreView";
}
public AdvPrintPreView():base()
{
foreach(Control c in this.Controls)
{
if( c is ToolBar )
{
foreach(Control sc in c.Controls)
{
if( sc is Button && sc.Text == "Close")
{
CheckBox checkBox = new CheckBox();
checkBox.Name = "Degree";
checkBox.Text = "Degree";
checkBox.CheckStateChanged +=new EventHandler(checkBox_CheckStateChanged);
checkBox.Size = new Size(70,30);
checkBox.Location = new Point(sc.Location.X+ sc.Size.Width + 2 , sc.Location.Y - 5 );
c.Controls.Add(checkBox);
checkBox.BringToFront();
}
}
}
}
}
private void checkBox_CheckStateChanged(object sender, EventArgs e)
{
MessageBox.Show("CheckBox Button clicked");
}
}
Here is a sample.
AdvPrintPreViewControl.zipBest regards,
Haneef