this is the code that I am using for showing Alias tags in trend. My problem is 'this.InstanceName'! Sometimes I can choose 'InstanceName', and sometimes i can't (it doesn't exist). Why is that so?
Code: Select all
namespace Neo.ApplicationFramework.Generated
{
using System.Windows.Forms;
using System;
using System.Drawing;
using Neo.ApplicationFramework.Tools;
using Neo.ApplicationFramework.Common.Graphics.Logic;
using Neo.ApplicationFramework.Controls;
using Neo.ApplicationFramework.Interfaces;
public partial class Screen30
{
void Screen30_Opened(System.Object sender, System.EventArgs e)
{
string CurrentAlias = this.InstanceName;
for (int i = 0; i < 5; i++)
{
TrendViewer.Curves[i].IsVisible = false;
}
if (CurrentAlias == "PT_101")
{TrendViewer.Curves[0].IsVisible = true;}
else if (CurrentAlias == "PT_102")
{TrendViewer.Curves[1].IsVisible = true;}
else if (CurrentAlias == "PT_103")
{TrendViewer.Curves[2].IsVisible = true;}
else if (CurrentAlias == "PT_104")
{TrendViewer.Curves[3].IsVisible = true;}
else if (CurrentAlias == "PT_105")
{TrendViewer.Curves[4].IsVisible = true;}
}
}
}