ControlSend removing the customized colors of an edit field. Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
Smile_
Posts: 858
Joined: 03 May 2020, 00:51

ControlSend removing the customized colors of an edit field.

05 May 2021, 11:40

Hi, guys
In case you got any idea about Class_CtlColors by @just me and ControlSend (ControlSendRaw) command.

I'm using that class to change the background and the text colors of an edit field.
My issue is that when I use ControlSend or ControlSendRaw command to send some numbers to that edit field both background and text colors back to the default theme and stay like that until the mouse hover it again.
I could use GuiControl, +Redraw, Edit to refresh the view but it flickers, I really prefer if it is just send the numbers without changing the colors if there is anyway to fix it.

Any help appreciated and thank you all.

The code can be something like this:

Code: Select all

#Include, Class_CtlColors.ahk
Gui, +HwndUI
Gui, Font, Bold
X := 0
Loop
{
    Gui, Add, Button, xm+%X% ym w30 HwndBtn gSend, % A_Index - 1
    If (A_Index = 10)
        Break
    X += 30
}
Gui, Add, Edit, xm ym+30 w300 +Center vEdit HwndEdit
CtlColors.Attach(Edit, "000000", "FEFF00")
Gui, Show
Return

GuiClose:
ExitApp

Send:
    ControlSend, Edit1, % A_GuiControl, % "ahk_id " UI
    ;GuiControl, +Redraw, Edit
Return
Here is a Gif explaining what I mean:
ControlSend.gif
ControlSend & Edit
ControlSend.gif (502.53 KiB) Viewed 93 times
User avatar
Smile_
Posts: 858
Joined: 03 May 2020, 00:51

Re: ControlSend removing the customized colors of an edit field.  Topic is solved

05 May 2021, 12:30

Edit :
Thank you guys, the issue is fixed by enabling the text mode
Like this ControlSend, Edit1, % "{Text}" A_GuiControl, % "ahk_id " UI, by adding {Text} prefix to the keys parameter.

Topic is still open for any other suggestions!

Note: that doesn't seems to work with ControlSendRaw

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Ragnar and 353 guests