با سلام
استیمول من نسخه پرتابل هست و کامل نیست اگر میتونید به صورت ShowDialog باز کنید فکر میکنم کد زیر عمل کنه:
if (stiReport1.ShowDialog()==DialogResult.Cancel)
{
this.Close();
}
و یک کد دیگه هم نوشتم که متغیر ها رو لود نکرد یا شاید جاییش اشتباه کردم (استیمولم هم کامل نیست و مشکل داره چون به Event هاش دسترسی ندارم و قاطی میکنه) و زیادم وقت ندارم روش کار کنم
private void Print_Click(object sender, EventArgs e)
{
stiReport1.Load("مسیر فایل...");
Stimulsoft.Report.Render.StiPreviewForm stiPreviewForm = new Stimulsoft.Report.Render.StiPreviewForm(stiReport1 );
stiReport1.Render(true);
if (stiPreviewForm.ShowDialog()==DialogResult.Cancel)
{
this.Close();
}
}
از رویداد ها و Event هاش میتونید استفاده کنید مثلاً در کد بالا میشه از رویداد Closed هم به جای شرط if که قرار دادم استفاده کرد
private void Print_Click(object sender, EventArgs e)
{
stiReport1.Load(@"D:\Report.mrt");
Stimulsoft.Report.Render.StiPreviewForm stiPreviewForm = new Stimulsoft.Report.Render.StiPreviewForm(stiReport1 );
stiReport1.Render(true);
stiPreviewForm.FormClosed += stiPreviewForm_FormClosed;
stiPreviewForm.ShowDialog();
}
void stiPreviewForm_FormClosed(object sender, FormClosedEventArgs e)
{
this.Close();
}
فعلاً به دلیل مشکلات سیستمم در همین حد میتونم کمک کنم، ولی میتونم کاری کنم که بعد از پرینت گرفتن حتماً فرم بسته شود
موفق باشید