Skip to content

There is an issue with multiple buttons on one form #13

@leonid1812

Description

@leonid1812

Hello,

It is a good library, but for some reason it doesn't work well for me when I try to color multiple buttons on the page at once. Only the last button gets colored, while the others remain white. However, if I hover the mouse cursor over a button, it gets colored in the specified color. I have the latest version of AutoHotkey v2 installed.

Example of my code:
SubmitButton := MainForm.Add("Button", "x200 y595 w90 h30 Hidden", "✔️ Submit") ; Hidden
SubmitButton.SetColor(WindowsButtonColor, "0x000000", -1, "BABABA", 9)
SubmitButton.OnEvent("Click", SubmitButton_action)

CopyButton := MainForm.Add("Button", "x+10 yp w90 h30", "📄 Copy")
CopyButton.SetColor(WindowsButtonColor, "0x000000", -1, "BABABA", 9)
CopyButton.OnEvent("Click", CopyButton_action)
CopyButton.Redraw()

ReplaceButton := MainForm.Add("Button", "x+10 yp w90 h30", "✏️ Replace")
ReplaceButton.SetColor(WindowsButtonColor, "0x000000", -1, "BABABA", 9)
ReplaceButton.OnEvent("Click", ReplaceButton_action)
ReplaceButton.Redraw()

ExitButton := MainForm.Add("Button", "x+10 w90 h30", "🡆 Exit")
ExitButton.SetColor(WindowsButtonColor, "0x000000", -1, "BABABA", 9)
ExitButton.OnEvent("Click", MainForm_Exit) ; Close application UI
CopyButton.Redraw()

Result:
Image

After OnMouse hover:
Image

I tried to redraw the buttons, but this did not help.
CopyButton.Redraw()

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