NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Fix for XP visual styles in custom .NET Operator Interface without exe manifest?

Hi,
 
Have a problem trying to get the ActiveX controls displaying correctly in a custom .NET windows form operator interface (.NET forms version 2). I am using the new .net forms method Application.EnableVisualStyles(). This applies XP styling to the windows form application, but the TestStand activeX controls don't display images or comments properly (something to do with them being coded to use an old version of comctl32.dll).
This can be resolved for older versions of .NET forms by using a manifest file which references the correct comctl32 DLL, and is how the NI supplied operator interfaces get around this. However this approach seems to be unsuitable if a you use .net forms 2, and you want to implement a .NET ClickOnce deployment solution for your operator interface. In ClickOnce the manifest is automatically generated, and will blitz any ammendments - any ideas?
 
 
 
0 Kudos
Message 1 of 3
(3,386 Views)

Hi,

  unfortunately this is something that has already been brought to the attention of the developers.

The visual styles work for the .net controls, but for dialogs and activeX controls that are external to .net you still need the manifest file.

It is something that is being considered for the future, although when the next release might be, or if it will include this feature, then unfortunately I cannot say.

Thanks

Sacha Emery
National Instruments (UK)

// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 2 of 3
(3,367 Views)

Ok,

Finally found a way to get this working. First you need to add  the class from a related COM/XP styling Microsoft KB article (http://support.microsoft.com/kb/830033) into your .NET forms project. The class EnableThemingInScope will selectively apply XP styling. In my Form Main method I have removed the call to EnableVisualStyles , and instead invoke the EnableThemingInScope constructor around the call to Application.Run. Now I can have XP styling for my forms app and retain the default look and feel of the TestStand UI controls. Hope this helps someone else.

static void Main()

{

// doesn't work with TestStand 3.5 UI controls -- Application.EnableVisualStyles();

Application.SetCompatibleTextRenderingDefault(false);

Application.DoEvents();

using (new EnableThemingInScope(true))

{

Application.Run(new MainForm());

}

}

 

Message 3 of 3
(3,361 Views)