Results 1 to 31 of 31

Thread: Fix Visual Styles Issues (Themes)

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,730

    Fix Visual Styles Issues (Themes)

    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:
    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>
    Or just put attached resource fille into your application. That is the same just compiled into a resource.

    This need to be put on the Sub Main:
    Code:
    Private Sub Main()
    Call InitVisualStylesFixes
    Form.Show vbModeless
    End Sub
    To put on every Form Load event:
    Code:
    Private Sub Form_Load()
    Call SetupVisualStylesFixes(Me)
    End Sub
    To put on every Form Unload event: (Optional)
    Code:
    Private Sub Form_Unload(Cancel As Integer)
    Call RemoveVisualStylesFixes(Me)
    End Sub
    The Code is too long to put directly here. So I have attached it. (see CodeVisualStyles.txt)
    Attached Files Attached Files
    Last edited by Krool; Sep 26th, 2024 at 01:43 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width