james_langham

Setting the time range on an ad-hoc trend when added - C# add-in

Discussion created by james_langham on Dec 6, 2012
Latest reply on Dec 8, 2012 by Ahmad Fattahi

Hey all,

 

I've been making an add-in that sets the time range of all the symbols in a display automatically. My add-in works fine for adding new trends or opening old ones, but it doesn't work for ad-hoc trends.

 

The code I've been using is as follows:

 
        private void ActiveDisplay_AfterSymbolAdded(Symbol aSymbol)
        {
            aSymbol.SetTimeRange(savedStartTime, savedEndTime);
            this.app.ActiveDisplay.Refresh();
            System.Windows.Forms.Application.DoEvents();
        }

 

 

This event fires when an ad-hoc trend is added but, when it completes, the trend shows the default time range set by PB.

 

Anyone have any ideas?

 

James

Outcomes