Visual Styles for .NET Controls in LabVIEW .NET Containers Primary Software: LabVIEW Development Systems>>Base PackagePrimary Software Version: 8.5 Primary Software Fixed Version: N/A Secondary Software: Measurement Studio>>.NET Support
Problem: Why do the controls in my .NET form display differently when placed in a LabVIEW .NET container? Solution: .NET controls are not constrained to one specific visual style. You can even create your own visual styles, templates, etc., and store them in a resource file for reuse. To that end, you can perform redirection to your visual styles at runtime from any programming environment, including LabVIEW. In Windows XP, the concept of Visual Styles was introduced to allow customization of the look and feel of windows and controls. Most applications that target Windows XP and above should take advantage of Visual Styles. To enable this, Microsoft distributed a new version of the comctl32.dll (version 6.0) which is a side-by-side assembly deployed to \WINDOWS\WinSxs.\ Note: Version 5.8 of the DLL renders controls in the "classic" style that came with Windows NT/2000 and Windows 9.x. To avoid compatibility issues (because the XP style controls are part of a new version of the Windows Common Controls), applications do not automatically use the XP styles. Instead, an application that wishes to link to the updated version of the Common Controls needs to explicitly state this desire through the use of a manifest file. In .NET, you can simply call the Application.EnableVisualStyles method before you instantiate your application. You cannot, however, do this in LabVIEW. The alternative is to create a manifest file. From a LabVIEW perspective, the concept of manifest files is discussed in the LabVIEW help topics "Editing the Application Manifest", "Applying the Application Manifest", etc. At this point, you can choose to embed the manifest or just have it in the same directory as the executable. The contents of the manifest need to include references to the newer DLL as shown below: <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <description>Windows Forms Common Control manifest</description> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*" /> </dependentAssembly> </dependency> </assembly> If your executable is called dddddd.exe, then your manifest would be ddddd.exe.manifest as shown below: When you add the manifest to your executable, it will now use the version 6.0 of the DLL which contains the visual styles. Related Links: Attachments:
Report Date: 12/04/2007 Last Updated: 12/07/2007 Document ID: 4G389HSN |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
