Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Class_CTLCOLORS - color your controls


  • Please log in to reply
10 replies to this topic
just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011

!!! Moved to http://ahkscript.org....php?f=6&t=2197 !!!

Attached Thumbnails

  • CTLCOLORS.png

Edited by just me, 15 February 2014 - 06:43 AM.


Husen
  • Guests
  • Last active:
  • Joined: --
Great.
Did I just looking for something like this.
Problem has been resolved in your favor.

This article may be difficult to read because machine translation.
To say thank you anyway. :D

  • Guests
  • Last active:
  • Joined: --
Hello just me,
Thanks for this great work, its exactly what I needed
Came from here:
http://www.autohotke...php?f=1&t=86127

fump2000
  • Members
  • 591 posts
  • Last active: Nov 11 2015 07:52 AM
  • Joined: 01 Nov 2012

Hello just me,
can you tell me why it does not work with my code?

Here is my code:

#Persistent
#SingleInstance force
SetBatchLines, -1
#NoEnv
#Include Class_CTLCOLORS.ahk

xPos := 12
yPos := 10
Loop, 7
{
    Gui, Add, Text, x%xPos% y%yPos% w20 h10 border HWNDh_A%A_Index% vA%A_Index% gCallColor 0x0100,
    Gui, Add, Text, xp+22 yp w20 h10 border HWNDh_B%A_Index% vB%A_Index% gCallColor 0x0100,
    Gui, Add, Text, xp+22 yp w20 h10 border HWNDh_C%A_Index% vC%A_Index% gCallColor 0x0100,
    Gui, Add, Text, xp+22 yp w20 h10 border HWNDh_D%A_Index% vD%A_Index% gCallColor 0x0100,
    Gui, Add, Text, xp+22 yp w20 h10 border HWNDh_E%A_Index% vE%A_Index% gCallColor 0x0100,
    Gui, Add, Text, xp+22 yp w20 h10 border HWNDh_F%A_Index% vF%A_Index% gCallColor 0x0100,
    Gui, Add, Text, xp+22 yp w20 h10 border HWNDh_G%A_Index% vG%A_Index% gCallColor 0x0100,
    Gui, Add, Text, xp+22 yp w20 h10 border HWNDh_H%A_Index% vH%A_Index% gCallColor 0x0100,
    Gui, Add, Text, xp+22 yp w20 h10 border HWNDh_I%A_Index% vI%A_Index% gCallColor 0x0100,
    if (A_Index = 2 || A_Index = 3 || A_Index = 4 || A_Index = 5 || A_Index = 6 || A_Index = 7)
        yPos+=12
}

CTLCOLORS.Attach(h_A1, "FF8080", "FFFFFF")

Gui, Add, Radio, x222 y10 w100 h20 checked, Hintergrundfarbe
Gui, Add, Radio, x222 y30 w100 h20 , Textfarbe
Gui, Add, Text, x12 y92 w120 h20 , Eigener HEX Farbcode:
Gui, Add, Edit, x132 y91 w50 h18 HWNDDEDE1,
CTLCOLORS.Attach(DEDE1, "FF8080", "FFFFFF")
Gui, Show, x746 y244 h379 w361,
Return

GuiSize:
If (A_EventInfo != 1) {
Gui, %A_Gui%:+LastFound
WinSet, ReDraw
}
Return

CallColor:
Helper := A_GuiControl
msgbox %Helper%
Return

GuiClose:
ExitApp


just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011

Yes, because control A2 is painted on A1 (you do not increase yPos after the first iteration of your loop).


Prefer ahkscript.org for the time being.


fump2000
  • Members
  • 591 posts
  • Last active: Nov 11 2015 07:52 AM
  • Joined: 01 Nov 2012
 
Have detected the error. Thanks for the tip!


Dr_Holle
  • Members
  • 105 posts
  • Last active: Mar 26 2014 10:10 AM
  • Joined: 18 Dec 2012

Great!

It´s exact what I´m searching for :-)



fump2000
  • Members
  • 591 posts
  • Last active: Nov 11 2015 07:52 AM
  • Joined: 01 Nov 2012

Big thx for the update!



Larctic
  • Members
  • 303 posts
  • Last active: May 10 2016 04:56 PM
  • Joined: 21 Jul 2012

Can add "Button" examples do? Thanks.



just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011

; Function:          Helper object to color controls on WM_CTLCOLOR... notifications.
;                    Supported controls are: Checkbox, ComboBox, DropDownList, Edit, ListBox, Radio, Text.
;                    Checkboxes and Radios accept background colors only due to design.

 

This class does not support pushbuttons.

 

But you might here or here.


Prefer ahkscript.org for the time being.


Larctic
  • Members
  • 303 posts
  • Last active: May 10 2016 04:56 PM
  • Joined: 21 Jul 2012
Thanks. This is exactly what I need.happy.png