更改按钮的颜色

问题描述 投票:0回答:1
!include "MUI2.nsh"
!include "nsDialogs.nsh"
OutFile "Test.exe"

!define MUI_WELCOMEPAGE_TITLE "Welcome to the Example Installer"
!define MUI_WELCOMEPAGE_TEXT "This is an example NSIS installer."

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"

Section
    nsDialogs::Create 1018
    Pop $0

    ${NSD_CreateButton} 7u 10u 100u 12u "My Button"
    Pop $1
    SetCtlColors $1 0x00FF00 0x00FF00
    ${NSD_OnClick} $1 MyButtonClick

    ${NSD_CreateNumber} 10U 25% 100u 12u "Message Here"
    Pop $2
    SetCtlColors $2 0x00FF00 0x000000  ; Set the numeric control color

    nsDialogs::Show
SectionEnd

Function MyButtonClick
    # Button click handler
FunctionEnd

在这段代码中,我试图更改按钮颜色。但颜色仅在边框上发生变化。

我需要修改代码来更改按钮的颜色

material-ui nsis
1个回答
0
投票

Windows 并不真正支持更改按钮的颜色,您需要自己完全绘制按钮才能这样做。

您可以尝试其中一种皮肤插件(或此商业产品),但除非您也更改所有其他元素的颜色,否则我建议您不要这样做。

© www.soinside.com 2019 - 2024. All rights reserved.