When there are multiple `AddRadioButton`s, the icons placed with `.AddCustomButton` are misaligned.

Open
#18 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
visualbasic
Domain
desktop

Research direction

Reproduce the provided Sample_NoCustomIcon_multiRadioButtons case using cTaskDialog, focusing on the interaction between AddRadioButton, AddCustomButton, and ShowDialog. Compare the displayed custom-button icons with the button order and radio-button count; done means each custom button keeps its assigned icon when multiple radio buttons are present.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Visual Basic 6.0
Stars
49
Forks
8
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fafalone/cTaskDialog64

All issues in fafalone/cTaskDialog64

Similar issues

More Desktop Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.