Hello,
this function will fix properly following issues with Visual Styles (Themes):
- Frame control (black background on controls)
- Focus rectangles not shown
- Accelerator keys not shown
- CommandButton, CheckBox and OptionButton with Graphical Style not themed
In order to use this function you first need to create a manifest:
Or just put attached resource fille into your application. That is the same just compiled into a resource.Code:<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" language="*" processorArchitecture="*" publicKeyToken="6595b64144ccf1df"/> </dependentAssembly> </dependency> </assembly>
This need to be put on the Sub Main:
To put on every Form Load event:Code:Private Sub Main() Call InitVisualStylesFixes Form.Show vbModeless End Sub
To put on every Form Unload event: (Optional)Code:Private Sub Form_Load() Call SetupVisualStylesFixes(Me) End Sub
The Code is too long to put directly here. So I have attached it. (see CodeVisualStyles.txt)Code:Private Sub Form_Unload(Cancel As Integer) Call RemoveVisualStylesFixes(Me) End Sub




Reply With Quote