AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

edit controls with transparency

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
The annoying bug!
Guest





PostPosted: Tue Feb 02, 2010 4:04 pm    Post subject: edit controls with transparency Reply with quote

I have two edit controls over a picture with some transparency
Watch what happens when I disable the edit controls

The background..



all enabled...



Watch what happens when the edit controls are disabled (with f5) !

edit boxes background have became transparent...thats undesirable for me

What to do now?


[Title edited. Please write descriptive titles for your topics. ~jaco0646]
Back to top
The annoying bug!
Guest





PostPosted: Tue Feb 02, 2010 4:07 pm    Post subject: Reply with quote

Code:
background:="axpssplogo.png"
Gui, 1: Add, Picture, x0 y0  BackgroundTrans , %background%
Gui, 1: Add, Edit, vName x100 y80 -WantReturn
Gui, 1: Add, Edit, vNumber yp+30  -WantReturn

Gui, 1: Color, blue
Gui, 1: +LastFound
WinSet, TransColor, blue
gui, 1: -Caption  -SysMenu +Owner -Resize
gui, 1: Show, Center


RETURN

f5::
   GuiControl, 1:Disable, Name
   GuiControl, 1:Disable, Number
return

f6::
   GuiControl, 1:Enable, Name
   GuiControl, 1:Enable, Number
return
Back to top
The annoying bug!
Guest





PostPosted: Tue Feb 02, 2010 4:09 pm    Post subject: Reply with quote

All answers welcomed!

Thank you in advance!
Back to top
jaco0646



Joined: 07 Oct 2006
Posts: 3113
Location: MN, USA

PostPosted: Tue Feb 02, 2010 5:42 pm    Post subject: Reply with quote

Could you use Hide/Show instead of Disable/Enable?
Back to top
View user's profile Send private message Visit poster's website
The annoying bug!
Guest





PostPosted: Tue Feb 02, 2010 6:13 pm    Post subject: Reply with quote

Unfortunately no.
Back to top
jaco0646



Joined: 07 Oct 2006
Posts: 3113
Location: MN, USA

PostPosted: Tue Feb 02, 2010 6:56 pm    Post subject: Reply with quote

How about this?
Code:
background:="axpssplogo.png"
Gui, 1: Add, Picture, x0 y0  BackgroundTrans , %background%
Gui, 1: Add, Edit, vName x100 y80 -WantReturn
Gui, 1: Add, Text, vTxt1 xp yp wp hp Hidden BackgroundTrans
Gui, 1: Add, Edit, vNumber yp+30  -WantReturn
Gui, 1: Add, Text, vTxt2 xp yp wp hp Hidden BackgroundTrans

Gui, 1: Color, blue
Gui, 1: +LastFound
WinSet, TransColor, blue
gui, 1: -Caption  -SysMenu +Owner -Resize
gui, 1: Show, Center


RETURN

f5::
   Gui, Submit, NoHide
   GuiControl, 1:, Txt1, %Name%
   GuiControl, 1:, Txt2, %Number%
   GuiControl, 1:Show, Txt1
   GuiControl, 1:Show, Txt2
   GuiControl, 1:Hide, Name
   GuiControl, 1:Hide, Number
return

f6::
   GuiControl, 1:Hide, Txt1
   GuiControl, 1:Hide, Txt2
   GuiControl, 1:Show, Name
   GuiControl, 1:Show, Number
return
Back to top
View user's profile Send private message Visit poster's website
complx



Joined: 22 Jan 2010
Posts: 34
Location: Germany

PostPosted: Tue Feb 02, 2010 7:57 pm    Post subject: Reply with quote

or this

Code:

background:="axpssplogo.png"
Gui, 1: Add, Picture, x0 y0 BackgroundTrans , %background%
Gui, 1: Add, Edit, vName x100 y80 -WantReturn
Gui, 1: Add, Text, vTxt1 xp+3 yp+3 wp-6 hp-6 Hidden -BackgroundTrans
Gui, 1: Add, Edit, vNumber xp-3 yp+27  -WantReturn
Gui, 1: Add, Text, vTxt2 xp+3 yp+3 wp-6 hp-6 Hidden -BackgroundTrans

Gui, 1: Color, blue
Gui, 1: +LastFound
Gui, Color,, F0F0F0

WinSet, TransColor, blue
gui, 1: -Caption  -SysMenu +Owner -Resize
gui, 1: Show, Center


RETURN

f5::
   Gui, Submit, NoHide
   GuiControl, 1:, Txt1, %Name%
   GuiControl, 1:, Txt2, %Number%
   GuiControl, 1:Show, Txt1
   GuiControl, 1:Show, Txt2
   GuiControl, 1:Hide, Name
   GuiControl, 1:Hide, Number
return

f6::
   GuiControl, 1:Hide, Txt1
   GuiControl, 1:Hide, Txt2
   GuiControl, 1:Show, Name
   GuiControl, 1:Show, Number
return


Keeping a little of the edit fields background, not so nice cause of the missing rounded corners...but this could be solved with an appropriate background graphic.
_________________
complx

“Give a man a fish; you have fed him for today. Teach a man to fish; and you have fed him for a lifetime”—Author unknown
Back to top
View user's profile Send private message
Guest






PostPosted: Wed Feb 03, 2010 7:39 am    Post subject: Reply with quote

Yes, it is a solution, thank you v.much! Very Happy
I've thought about it, I just wanted another opinion or another approach.

Till then, I ll stick to your code, but Ive made some modification, because I like better when borders of edit boxes are also visible.

Code:
background:="axpssplogo.png"
Gui, 1: Add, Picture, x0 y0 BackgroundTrans , %background%
Gui, 1: Add, Edit, vName x100 y80 -WantReturn
Gui, 1: Add, Text, cRed vTxt1 xp+3 yp+3 wp-6 hp-6 Hidden -BackgroundTrans
Gui, 1: Add, Edit, vNumber xp-3 yp+27  -WantReturn
Gui, 1: Add, Text, cRed vTxt2 xp+3 yp+3 wp-6 hp-6 Hidden -BackgroundTrans

Gui, 1: Color, blue
Gui, 1: +LastFound
Gui, Color,, F0F0F0

WinSet, TransColor, blue
gui, 1: -Caption  -SysMenu +Owner -Resize
gui, 1: Show, Center


RETURN

f5::
   Gui, Submit, NoHide
   GuiControl, 1:Disable, Name
   GuiControl, 1:Disable, Number   
   GuiControl, 1:, Txt1, %Name%
   GuiControl, 1:, Txt2, %Number%
   GuiControl, 1:Show, Txt1
   GuiControl, 1:Show, Txt2
   ;GuiControl, 1:Hide, Name
   ;GuiControl, 1:Hide, Number
return

f6::
   GuiControl, 1:Enable, Name
   GuiControl, 1:Enable, Number
   GuiControl, 1:Hide, Txt1
   GuiControl, 1:Hide, Txt2
   ;GuiControl, 1:Show, Name
   ;GuiControl, 1:Show, Number
return
Back to top
The annoying bug!
Guest





PostPosted: Wed Feb 03, 2010 8:31 am    Post subject: Reply with quote

Ahh!!!! Smile ..the precious solution, "-BackgroundTrans "..


Code:
background:="axpssplogo.png"
Gui, 1: Add, Picture, x0 y0  BackgroundTrans , %background%
Gui, 1: Add, Edit, vName x100 y80 -WantReturn -BackgroundTrans
Gui, 1: Add, Edit, vNumber yp+30  -WantReturn  -BackgroundTrans

Gui, 1: Color, blue
Gui, 1: +LastFound
WinSet, TransColor, blue
gui, 1: -Caption  -SysMenu +Owner -Resize
gui, 1: Show, Center


RETURN

f5::
   GuiControl, 1:Disable, Name
   GuiControl, 1:Disable, Number
return

f6::
   GuiControl, 1:Enable, Name
   GuiControl, 1:Enable, Number
return



Solved
Back to top
Guest






PostPosted: Wed Feb 03, 2010 10:41 am    Post subject: Reply with quote

Sorry, but it's -Background
Back to top
The annoying bug!
Guest





PostPosted: Wed Feb 03, 2010 3:26 pm    Post subject: Reply with quote

Anonymous wrote:
Sorry, but it's -Background

Guest, both works (-BackgroundTrans or -Background)
Back to top
complx



Joined: 22 Jan 2010
Posts: 34
Location: Germany

PostPosted: Wed Feb 03, 2010 8:06 pm    Post subject: Reply with quote

The annoying bug! wrote:
Ahh!!!! Smile ..the precious solution, "-BackgroundTrans "..


lol, all the playing with text fields and blind for beginning, I should not code past 8 p.m. *facepalm*
_________________
complx

“Give a man a fish; you have fed him for today. Teach a man to fish; and you have fed him for a lifetime”—Author unknown
Back to top
View user's profile Send private message
Guest






PostPosted: Wed Feb 03, 2010 9:38 pm    Post subject: Reply with quote

The annoying bug! wrote:
Guest, both works...

...I'm a different Guest, but -BackgroundRed would likely "work"...the point is the option is "Background", the color is "trans" & you don't need to specify a color when removing the option...
Back to top
nick



Joined: 24 Aug 2005
Posts: 549
Location: Berlin / Germany

PostPosted: Thu Feb 04, 2010 8:12 am    Post subject: Reply with quote

Yes, both "work", and even -BackgroundAndForeground and -BackgroundWhite, too. "Gracious" AHK will permit everything following the word "Background" in the options of an Edit control and take it as -Background.
That's why the option is
Code:
-Background

_________________
nick Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group