Skip to content

When there are multiple AddRadioButtons, the icons placed with .AddCustomButton are misaligned. #18

@Eschamali

Description

@Eschamali

Hello. Thank you very much for the fix in issue #11.

I attempted to reopen that issue because I found an additional problem, but I received a "no permission" error. Therefore, I apologize for creating a new issue.

I have confirmed that the procedure Sample_NoCustomIcon from issue #11 works correctly. (Code omitted here.)

However, in practical use cases, it is very common to have multiple radio buttons.

For example:

Private Sub Sample_NoCustomIcon_multiRadioButtons()
    Dim testIcon As LongPtr, tmp As LongPtr
    Debug.Print ExtractIconExA("C:\Windows\System32\SHELL32.dll", 0, tmp, testIcon, 1)

    With New cTaskDialog
        .CommonButtons = TDCBF_CLOSE_BUTTON
        
        .AddRadioButton 201, "testChose1"
        .AddRadioButton 202, "testChose2"
        
        .AddCustomButton 102, "button 2", testIcon
        .AddCustomButton 101, "button 3", testIcon

        .Flags = TDF_USE_COMMAND_LINKS

        .ParenthWnd = Application.hWnd
        .ShowDialog

    End With

End Sub
Image

When there are multiple AddRadioButton calls like this, the icon assigned in .AddCustomButton 102 is no longer displayed.

Based on my own testing, it seems that the icon assignment for .AddCustomButton is offset by the number of radio buttons added. In other words, the icon index appears to shift when radio buttons are present.

Would it be possible to ensure that the icon assignment for .AddCustomButton remains correct even when multiple .AddRadioButton calls are used?

Thank you very much for your time and support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions