05-14-2009 02:49 PM
Hi Dasi,
The problem you are seeing in your dotnet code is different from the problem you were seeing in LabVIEW. As I suspected, it appears to be caused by the issue I described in my last reply in item 2). I took the example you attached and put Microsoft ActiveX controls in place of the TestStand expression controls and saw exactly the same problem. It appears to happen with any ActiveX control used in this way. I do not know if Microsoft is ever planning on fixing this, however I did figure out a workaround that might work for you. If you add the following code to the user control in your example it will ensure that the expression controls on the tabs are visible at least in this test case. If your actually use case is different you can probably still do something similar. The basic idea of the workaround is to hide and reshow the expression controls in the cases in which they get incorrectly hidden. Here's the code to add to the user control in your example:
protected override void OnCreateControl()
{
base.OnCreateControl();
foreach (TabPage tabPage in this.tabControl1.TabPages)
{
foreach (Control ctrl in tabPage.Controls)
{
if (ctrl is NationalInstruments.TestStand.Interop.UI.Ax.AxExpressionEdit)
{
ctrl.Hide();
ctrl.Show();
}
}
}
}
Hope this helps. Let us know if you still have any questions related to this.
-Doug
05-15-2009 02:05 AM
Thanks a ton, Doug! That solved the problem!
And you were right, the problem occurs with all ActiveX controls, and your reply has been a great tip!
Thanks for all the help again!
Best regards,
Subhash