I'm sorry for my english x)
I need to make an application that runs an action when I go to the Preview screen and when I go to the Designer screen.
At the moment, when I go to the Preview Screen, I use this event:
Code: Select all
StiOptions.Engine.GlobalEvents.ReportCompiling += ...
but when this happens, I need to execute a method.
Right now I am using this event:
Code: Select all
public Form1()
{
InitializeComponent();
StiOptions.Engine.GlobalEvents.ReportCompiling += new EventHandler(GlobalEvents_ReportCompiling);
StiPage.PagePainting += new StiPagePaintEventHandler(StiPage_PagePainted); //I need to replace this event with one that runs only when I go to Designer Screen
}
private void StiPage_PagePainted(object sender, EventArgs e)
{
if ((e as StiPagePaintEventArgs).IsDesigning) //and here I check which screen is going
{
//Runs when open the Designer Screen...
}
}
void GlobalEvents_ReportCompiling(object sender, EventArgs e)
{
//Runs when open the Preview Screen...
}
Thank you.