How to change the color of specific edit box in GUI?

Get help with using AutoHotkey and its commands and hotkeys
User avatar
Sabestian Caine
Posts: 206
Joined: 12 Apr 2015, 03:53

How to change the color of specific edit box in GUI?

19 Nov 2017, 09:36

Friends I made this simple gui which has only three edit boxes-

Code: [Select all] [Download] GeSHi © Codebox Plus

Gui, Add, Edit, x36 y20 w100 h30, Edit1
Gui, Add, Edit, x36 y70 w100 h30, Edit2
Gui, Add, Edit, x36 y120 w100 h30, Edit3
Gui, Show, w226 h214, Untitled GUI



The gui looks like this-
Image

I want that the color of edit1 and edit2 should be light green whose color id is 0x99FF33 and the color of edit3 should be 0xE6B9B8. It should look like this-
Image

I tried to change the color of edit box by inserting this line Gui, color,, 0x99FF33 of code into above codes, but after adding this line the color of all edit boxes are changed like this-
Image

Please tell me how to overcome this problem. Thanks a lot..
I don't normally code as I don't code normally.
YOU do what YOU want, but happens what HE wants.
YOU do what HE wants, will happen what YOU want.
Georgie Munteer

Re: How to change the color of specific edit box in GUI?

19 Nov 2017, 09:50

when you place this on top of all edit boxes Gui, color,, 0x99FF33 all will have this color. You must place a new Gui, color,, [other color] on top of the edit box you want not to have the green

if this is not the issue please post the entire code
User avatar
Sabestian Caine
Posts: 206
Joined: 12 Apr 2015, 03:53

Re: How to change the color of specific edit box in GUI?

19 Nov 2017, 10:22

Georgie Munteer wrote:when you place this on top of all edit boxes Gui, color,, 0x99FF33 all will have this color. You must place a new Gui, color,, [other color] on top of the edit box you want not to have the green

if this is not the issue please post the entire code


Sir i tried the codes like this-

Code: [Select all] [Download] GeSHi © Codebox Plus

Gui, Add, Edit, x36 y20 w100 h30, Edit1
Gui, color,, 0x99FF33
Gui, Add, Edit, x36 y70 w100 h30, Edit2
Gui, Add, Edit, x36 y120 w100 h30, Edit3
Gui, Show, w226 h214, Untitled GUI


then it showed all edit boxes green while i want only first two edit boxes to be green. Pls tell what should i do?
I don't normally code as I don't code normally.
YOU do what YOU want, but happens what HE wants.
YOU do what HE wants, will happen what YOU want.
Georgie Munteer

Re: How to change the color of specific edit box in GUI?

19 Nov 2017, 10:56

Sabestian Caine wrote:
Georgie Munteer wrote:when you place this on top of all edit boxes Gui, color,, 0x99FF33 all will have this color. You must place a new Gui, color,, [other color] on top of the edit box you want not to have the green

if this is not the issue please post the entire code


Sir i tried the codes like this-

Code: [Select all] [Download] GeSHi © Codebox Plus

Gui, Add, Edit, x36 y20 w100 h30, Edit1
Gui, color,, 0x99FF33
Gui, Add, Edit, x36 y70 w100 h30, Edit2
Gui, Add, Edit, x36 y120 w100 h30, Edit3
Gui, Show, w226 h214, Untitled GUI


then it showed all edit boxes green while i want only first two edit boxes to be green. Pls tell what should i do?

see this maybe it can help u, never thought this would be so difficult, when u resolve let us know what u did

https://autohotkey.com/board/topic/7241 ... und-color/
User avatar
Sabestian Caine
Posts: 206
Joined: 12 Apr 2015, 03:53

Re: How to change the color of specific edit box in GUI?

20 Nov 2017, 23:21

Georgie Munteer wrote:
Sabestian Caine wrote:
Georgie Munteer wrote:when you place this on top of all edit boxes Gui, color,, 0x99FF33 all will have this color. You must place a new Gui, color,, [other color] on top of the edit box you want not to have the green

if this is not the issue please post the entire code


Sir i tried the codes like this-

Code: [Select all] [Download] GeSHi © Codebox Plus

Gui, Add, Edit, x36 y20 w100 h30, Edit1
Gui, color,, 0x99FF33
Gui, Add, Edit, x36 y70 w100 h30, Edit2
Gui, Add, Edit, x36 y120 w100 h30, Edit3
Gui, Show, w226 h214, Untitled GUI


then it showed all edit boxes green while i want only first two edit boxes to be green. Pls tell what should i do?

see this maybe it can help u, never thought this would be so difficult, when u resolve let us know what u did

https://autohotkey.com/board/topic/7241 ... und-color/


Dear Georgie Munteer i am not getting any idea how to change the color of specific edit box by the link you mentioned in the above post. Could you plz give an example how can i do that? please help. thanks...
I don't normally code as I don't code normally.
YOU do what YOU want, but happens what HE wants.
YOU do what HE wants, will happen what YOU want.
User avatar
SpeedMaster
Posts: 99
Joined: 12 Nov 2016, 16:09

Re: How to change the color of specific edit box in GUI?

21 Nov 2017, 10:24

Hello,
Try this class ;)

Class CtlColors by Just me
https://autohotkey.com/boards/viewtopic.php?f=6&t=2197

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

User avatar
Sabestian Caine
Posts: 206
Joined: 12 Apr 2015, 03:53

Re: How to change the color of specific edit box in GUI?

23 Nov 2017, 02:42

SpeedMaster wrote:Hello,
Try this class ;)

Class CtlColors by Just me
https://autohotkey.com/boards/viewtopic.php?f=6&t=2197

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus




thank you so much dear SpeedMaster.....
the codes provided by you are just working great....
sir i want to one more thing...
as my script is very small and for changing the color of only three edit boxes i have to include the codes of more than 300 hundred lines into my script. Isn't there any small way to change the colors of these three edit boxes? If you could please give me small and sweet way to do this i will be highly obliged to you... as far as i searched ahk forum related to changing colors of edit boxes, there is not any straight way of doing this... i don't know it is possible or not... please help... thanks a lot....
I don't normally code as I don't code normally.
YOU do what YOU want, but happens what HE wants.
YOU do what HE wants, will happen what YOU want.
just me
Posts: 4863
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: How to change the color of specific edit box in GUI?

23 Nov 2017, 04:41

A bit shorter, but your Edits must not be ReadOnly:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Remaining with AHK 1.1.25.02 until v2 will become beta.
User avatar
Sabestian Caine
Posts: 206
Joined: 12 Apr 2015, 03:53

Re: How to change the color of specific edit box in GUI?

27 Nov 2017, 23:21

just me wrote:A bit shorter, but your Edits must not be ReadOnly:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus




Thank You so much dear just me.....
you are really great....
i always love your skills at ahk.....
thank you so much once again..... :salute: :bravo:
I don't normally code as I don't code normally.
YOU do what YOU want, but happens what HE wants.
YOU do what HE wants, will happen what YOU want.

Return to “Ask For Help”

Who is online

Users browsing this forum: holahapi, tijger and 37 guests