Getting the event when user close the preveiw report

Stimulsoft Reports.NET discussion
Post Reply
ngaheer
Posts: 44
Joined: Sat Jul 22, 2006 1:12 am
Location: San Jose

Getting the event when user close the preveiw report

Post by ngaheer »

Hi,

i m using the following code
report.Show(False)

my need is when user close the preview control(Window) i need a event which tells us the user clicks on close buttion.

Thanks,
Waiting ur reply
Brendan
Posts: 309
Joined: Sun Jul 16, 2006 12:42 pm
Location: Ireland

Getting the event when user close the preveiw report

Post by Brendan »

You can hook into the standard .net Form Closing Event (Closing or FormClosing depending on which version of .net you use)

Code: Select all

report.Render();
Stimulsoft.Report.Render.StiPreviewForm previewForm = new Stimulsoft.Report.Render.StiPreviewForm(report);
previewForm.Closing += new CancelEventHandler(previewForm_Closing);

previewForm.Show();



private void previewForm_Closing(object sender, CancelEventArgs e)
{
	if(MessageBox.Show("Close Preview?", "Preview Report", MessageBoxButtons.YesNo) == DialogResult.No)
		e.Cancel = true;
}
Post Reply