Advertisement
3_2004-2005 Custom Controls/ Forms/ Menus #143986

True XP Controls, with 1 API

Objective: To create and use a manifest file for displaying common controls WinXP style on a machine running WinXP with the XP theme enabled. Function: This code will only provide WinXP controls on a machine running WinXP. The XP theme must be enabled (Not the classic theme) for this code to work properly. Also, this only works when the program is compiled as an executable, and will not work in the IDE environment. Once the InitXP sub is called, all forms and controls (the main controls and any controls in the "Microsoft Windows Common Controls 5.0 (SP2)" ocx) on all forms will be display in winXP style, so you only have to call the sub once. Also, MsgBox's and InputBox's will have the xP theme. What's cool about this code is if the xP theme is enabled, but a different color scheme is used (other than the default blue), the manifest automatically acounts for that. The truely great thing about this is that no new activex controls are introduced, and therefor you do not need to account for different OS. If you want XP controls on machines other than XP, there are hundreds of controls on the net. This code reduces deployment costs, is small, and is self-contained. I have not tested the code on any machine other than winxp, but this should not generate any errors. If it does, a simple call to "GetVersionEx" could show which OS is running, and in the Sub InitXP, add the code: If WinXP = True Then all current code End If Known Problems: Command Buttons, Option Buttons, and Frames do not display properly when placed inside of another Frame. Currently working on this problem. One last note: The exe will not display XP controls the first time it is run, and I have not found a way around that yet . . . Maybe creating a program that first creates the manifest, then shell's the main program before ending . . . Or maybe the install program could solve it somehow Credit: I got the idea from this code from another source, I believe on planet source code, but the code did not work, and was not well organized/commented. I have no idea who the genious was that came up with this code, but all the credit in the world goes to that person.

AI

สรุปโดย AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

ซอร์สโค้ด
original-source
Upload
ความคิดเห็นดั้งเดิม (3)
กู้คืนจาก Wayback Machine