xShadowx Posted September 19, 2008 Share Posted September 19, 2008 GuiCtrlCreatePic("1.jpg", 0, 0, 131, 300) GuiCtrlSetState(-1, $GUI_DISABLE) I have a a background image, and im wondering if there is a way to make it so I can see text through the picture? Link to comment Share on other sites More sharing options...
rasim Posted September 19, 2008 Share Posted September 19, 2008 Maybe this be easy: #include <GuiConstantsEx.au3> $hGUI = GUICreate("Test", 300, 200) $pic = GUICtrlCreatePic(@WindowsDir & "\Web\Wallpaper\Windows XP.jpg", 10, 10, 280, 180) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateLabel("Test Text", 120, 75, 100, 20) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUISetState() Do Until GUIGetMsg() = -3 Link to comment Share on other sites More sharing options...
xShadowx Posted September 19, 2008 Author Share Posted September 19, 2008 Ok, when I do that, I have to press the exit button before I can see the input boxes/buttons. Is there a way around that? Link to comment Share on other sites More sharing options...
martin Posted September 19, 2008 Share Posted September 19, 2008 Ok, when I do that, I have to press the exit button before I can see the input boxes/buttons. Is there a way around that?Maybe you have created the buttons and inputs before the pic. If so move them so they are created after the pic. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
xShadowx Posted September 19, 2008 Author Share Posted September 19, 2008 (edited) Nope, its above the buttons/input boxes. Edit: I mean the buttons are below the code. Edited September 19, 2008 by xShadowx Link to comment Share on other sites More sharing options...
martin Posted September 19, 2008 Share Posted September 19, 2008 Ok, when I do that, I have to press the exit button before I can see the input boxes/buttons. Is there a way around that?Try adding the style $WS_CLIPSIBLINGS to the pic. I would expect that to fix it. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
xShadowx Posted September 19, 2008 Author Share Posted September 19, 2008 Do you mean like this? GUICtrlCreatePic("bg.jpg", 0, 0, 131, 330, $WS_CLIPSIBLINGS) Because it doesnt work. Link to comment Share on other sites More sharing options...
martin Posted September 19, 2008 Share Posted September 19, 2008 Do you mean like this? GUICtrlCreatePic("bg.jpg", 0, 0, 131, 330, $WS_CLIPSIBLINGS) Because it doesnt work.One last attempt. If you use $WS_CLIPSIBLINGS then try creating the pic after the other controls instead of before. If that doesn't work then I need to see some code that shows the problem because I can't reproduce it. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
xShadowx Posted September 19, 2008 Author Share Posted September 19, 2008 Still doesnt work, well it kinda does, you have to hover over the boxes then they come to the front. Link to comment Share on other sites More sharing options...
rasim Posted September 20, 2008 Share Posted September 20, 2008 Still doesnt work, well it kinda does, you have to hover over the boxes then they come to the front.Show your code. Link to comment Share on other sites More sharing options...
Valuater Posted September 20, 2008 Share Posted September 20, 2008 Show your code.or at least a small replication ( code ) of the problem8) Link to comment Share on other sites More sharing options...
xShadowx Posted September 20, 2008 Author Share Posted September 20, 2008 (edited) expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("TrayIconHide", 1) opt("GUIResizeMode",$GUI_DOCKALL) $name = '' $pass = '' While $name = '' Or $pass = '' GetUserName($name, $pass) WEnd Func GetUserName(ByRef $nn, ByRef $pp) ; GUI $Form1 = GUICreate("", 131, 220, 619, 451) GUICtrlCreateLabel("New User Name?", 5, 5, 770, 20, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlCreateLabel("Confirm Name.", 5, 46, 770, 20, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlCreateLabel("Password?", 5, 110, 770, 20, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlCreateLabel("Confirm Password.", 5, 150, 770, 20, -1, $GUI_WS_EX_PARENTDRAG) GUISetState(@SW_SHOW) $pic = GUICtrlCreatePic("back.jpg", 0, 0, 131, 290) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateLabel("New User Name", 5, 5, 770, 20) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUISetState() Do Until GUIGetMsg() = -3 ;$ $Input1 = GUICtrlCreateInput("", 5, 22, 121, 21) $Input2 = GUICtrlCreateInput("", 5, 62, 121, 21) $check = GUICtrlCreateButton("Ok", 5, 90, 75, 17, 0) $Input3 = GUICtrlCreateInput("", 5, 126, 121, 21) $Input4 = GUICtrlCreateInput("", 5, 166, 121, 21) $check1 = GUICtrlCreateButton("Ok", 5, 194, 75, 17, 0) GUICtrlCreateLabel("",0,225,131,1) GUICtrlSetBkColor(-1,0x666666) $alldone = GUICtrlCreateButton("Apply", 30, 230, 70, 22) Local $popup Local $popup1 $expanded = false While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ExitLoop Case $check If GUICtrlRead($Input1) <> '' and GUICtrlRead($Input1) = GUICtrlRead($Input2) Then $nn = GUICtrlRead($Input1) GUICtrlDelete($popup) $popup = GUICtrlCreateButton("", 100, 90, 25, 17, 0) GUICtrlSetBkColor(-1, 0x00CC00) Else $nn = '' $popup = GUICtrlCreateButton("", 100, 90, 25, 17, 0) GUICtrlSetBkColor(-1, 0xFF0000) EndIf Case $check1 If GUICtrlRead($Input3) <> '' and GUICtrlRead($Input3) = GUICtrlRead($Input4) Then $pp = GUICtrlRead($Input3) GUICtrlDelete($popup1) $popup1 = GUICtrlCreateButton("", 100, 194, 25, 17, 0) GUICtrlSetBkColor(-1, 0x00CC00) Else $pp = '' $popup1 = GUICtrlCreateButton("", 100, 194, 25, 17, 0) GUICtrlSetBkColor(-1, 0xFF0000) EndIf Case $alldone If $nn <> '' And $pp <> '' Then ExitLoop Else MsgBox(262144, "ERROR", "Please enter your User Name and Password") EndIf EndSwitch if not $expanded Then If $nn <> '' And $pp <> '' Then winmove($Form1,"", 619, 451,137, 290) EndIf EndIf WEnd GUIDelete($Form1) Return EndFunc Edited September 20, 2008 by xShadowx Link to comment Share on other sites More sharing options...
Valuater Posted September 20, 2008 Share Posted September 20, 2008 expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("TrayIconHide", 1) opt("GUIResizeMode",$GUI_DOCKALL) $name = '' $pass = '' While $name = '' Or $pass = '' GetUserName($name, $pass) WEnd Func GetUserName(ByRef $nn, ByRef $pp) ; GUI $Form1 = GUICreate("", 131, 220, 619, 451) GUICtrlCreateLabel("New User Name?", 5, 5, 770, 20, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlCreateLabel("Confirm Name.", 5, 46, 770, 20, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlCreateLabel("Password?", 5, 110, 770, 20, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlCreateLabel("Confirm Password.", 5, 150, 770, 20, -1, $GUI_WS_EX_PARENTDRAG) GUISetState(@SW_SHOW) ;$ $Input1 = GUICtrlCreateInput("", 5, 22, 121, 21) $Input2 = GUICtrlCreateInput("", 5, 62, 121, 21) $check = GUICtrlCreateButton("Ok", 5, 90, 75, 17, 0) $Input3 = GUICtrlCreateInput("", 5, 126, 121, 21) $Input4 = GUICtrlCreateInput("", 5, 166, 121, 21) $check1 = GUICtrlCreateButton("Ok", 5, 194, 75, 17, 0) GUICtrlCreateLabel("",0,225,131,1) GUICtrlSetBkColor(-1,0x666666) $alldone = GUICtrlCreateButton("Apply", 30, 230, 70, 22) Local $popup Local $popup1 $expanded = false While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ExitLoop Case $check If GUICtrlRead($Input1) <> '' and GUICtrlRead($Input1) = GUICtrlRead($Input2) Then $nn = GUICtrlRead($Input1) GUICtrlDelete($popup) $popup = GUICtrlCreateButton("", 100, 90, 25, 17, 0) GUICtrlSetBkColor(-1, 0x00CC00) Else $nn = '' $popup = GUICtrlCreateButton("", 100, 90, 25, 17, 0) GUICtrlSetBkColor(-1, 0xFF0000) EndIf Case $check1 If GUICtrlRead($Input3) <> '' and GUICtrlRead($Input3) = GUICtrlRead($Input4) Then $pp = GUICtrlRead($Input3) GUICtrlDelete($popup1) $popup1 = GUICtrlCreateButton("", 100, 194, 25, 17, 0) GUICtrlSetBkColor(-1, 0x00CC00) Else $pp = '' $popup1 = GUICtrlCreateButton("", 100, 194, 25, 17, 0) GUICtrlSetBkColor(-1, 0xFF0000) EndIf Case $alldone If $nn <> '' And $pp <> '' Then ExitLoop Else MsgBox(262144, "ERROR", "Please enter your User Name and Password") EndIf EndSwitch if not $expanded Then If $nn <> '' And $pp <> '' Then winmove($Form1,"", 619, 451,137, 290) EndIf EndIf WEnd GUIDelete($Form1) Return EndFunc There is no GUICtrlCreatePic() in this code.... ... So I cant help you! 8) Link to comment Share on other sites More sharing options...
xShadowx Posted September 20, 2008 Author Share Posted September 20, 2008 Crap, edited my post. Link to comment Share on other sites More sharing options...
Valuater Posted September 20, 2008 Share Posted September 20, 2008 Errors include.... GUISetState(@SW_SHOW) ; Removed Do ; Removed Until GUIGetMsg() = -3 Working code.... expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("TrayIconHide", 1) Opt("GUIResizeMode", $GUI_DOCKALL) $name = '' $pass = '' While $name = '' Or $pass = '' GetUserName($name, $pass) WEnd Func GetUserName(ByRef $nn, ByRef $pp) ; GUI $Form1 = GUICreate("", 131, 220, 619, 451) GUICtrlCreateLabel("New User Name?", 5, 5, 770, 20, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlCreateLabel("Confirm Name.", 5, 46, 770, 20, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlCreateLabel("Password?", 5, 110, 770, 20, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlCreateLabel("Confirm Password.", 5, 150, 770, 20, -1, $GUI_WS_EX_PARENTDRAG) $pic = GUICtrlCreatePic("back.jpg", 0, 0, 131, 290) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateLabel("Test Text", 120, 75, 100, 20) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUISetState() ;$ $Input1 = GUICtrlCreateInput("", 5, 22, 121, 21) $Input2 = GUICtrlCreateInput("", 5, 62, 121, 21) $check = GUICtrlCreateButton("Ok", 5, 90, 75, 17, 0) $Input3 = GUICtrlCreateInput("", 5, 126, 121, 21) $Input4 = GUICtrlCreateInput("", 5, 166, 121, 21) $check1 = GUICtrlCreateButton("Ok", 5, 194, 75, 17, 0) GUICtrlCreateLabel("", 0, 225, 131, 1) GUICtrlSetBkColor(-1, 0x666666) $alldone = GUICtrlCreateButton("Apply", 30, 230, 70, 22) Local $popup Local $popup1 $expanded = False While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ExitLoop Case $check If GUICtrlRead($Input1) <> '' And GUICtrlRead($Input1) = GUICtrlRead($Input2) Then $nn = GUICtrlRead($Input1) GUICtrlDelete($popup) $popup = GUICtrlCreateButton("", 100, 90, 25, 17, 0) GUICtrlSetBkColor(-1, 0x00CC00) Else $nn = '' $popup = GUICtrlCreateButton("", 100, 90, 25, 17, 0) GUICtrlSetBkColor(-1, 0xFF0000) EndIf Case $check1 If GUICtrlRead($Input3) <> '' And GUICtrlRead($Input3) = GUICtrlRead($Input4) Then $pp = GUICtrlRead($Input3) GUICtrlDelete($popup1) $popup1 = GUICtrlCreateButton("", 100, 194, 25, 17, 0) GUICtrlSetBkColor(-1, 0x00CC00) Else $pp = '' $popup1 = GUICtrlCreateButton("", 100, 194, 25, 17, 0) GUICtrlSetBkColor(-1, 0xFF0000) EndIf Case $alldone If $nn <> '' And $pp <> '' Then ExitLoop Else MsgBox(262144, "ERROR", "Please enter your User Name and Password") EndIf EndSwitch If Not $expanded Then If $nn <> '' And $pp <> '' Then WinMove($Form1, "", 619, 451, 137, 290) EndIf EndIf WEnd GUIDelete($Form1) Return EndFunc ;==>GetUserName Link to comment Share on other sites More sharing options...
xShadowx Posted September 20, 2008 Author Share Posted September 20, 2008 Is there a way to change the text color? Link to comment Share on other sites More sharing options...
Valuater Posted September 20, 2008 Share Posted September 20, 2008 I should tell you that the "colored" buttons should be created first and use GUICtrlSetState( $Button, $GUI_HIDE) then just use... GUICtrlSetState( $Button, $GUI_SHOW) in the loop 8) Link to comment Share on other sites More sharing options...
Valuater Posted September 20, 2008 Share Posted September 20, 2008 So, I guess your original problem went away? I changed the first red text line for you expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("TrayIconHide", 1) Opt("GUIResizeMode", $GUI_DOCKALL) $name = '' $pass = '' While $name = '' Or $pass = '' GetUserName($name, $pass) WEnd Func GetUserName(ByRef $nn, ByRef $pp) ; GUI $Form1 = GUICreate("", 131, 220, 619, 451) GUICtrlCreateLabel("New User Name?", 5, 5, 770, 20, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlSetColor( -1, 0xFF0000) GUICtrlCreateLabel("Confirm Name.", 5, 46, 770, 20, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlCreateLabel("Password?", 5, 110, 770, 20, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlCreateLabel("Confirm Password.", 5, 150, 770, 20, -1, $GUI_WS_EX_PARENTDRAG) $pic = GUICtrlCreatePic("back.jpg", 0, 0, 131, 290) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateLabel("Test Text", 120, 75, 100, 20) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUISetState() ;$ $Input1 = GUICtrlCreateInput("", 5, 22, 121, 21) $Input2 = GUICtrlCreateInput("", 5, 62, 121, 21) $check = GUICtrlCreateButton("Ok", 5, 90, 75, 17, 0) $Input3 = GUICtrlCreateInput("", 5, 126, 121, 21) $Input4 = GUICtrlCreateInput("", 5, 166, 121, 21) $check1 = GUICtrlCreateButton("Ok", 5, 194, 75, 17, 0) GUICtrlCreateLabel("", 0, 225, 131, 1) GUICtrlSetBkColor(-1, 0x666666) $alldone = GUICtrlCreateButton("Apply", 30, 230, 70, 22) Local $popup Local $popup1 $expanded = False While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ExitLoop Case $check If GUICtrlRead($Input1) <> '' And GUICtrlRead($Input1) = GUICtrlRead($Input2) Then $nn = GUICtrlRead($Input1) GUICtrlDelete($popup) $popup = GUICtrlCreateButton("", 100, 90, 25, 17, 0) GUICtrlSetBkColor(-1, 0x00CC00) Else $nn = '' $popup = GUICtrlCreateButton("", 100, 90, 25, 17, 0) GUICtrlSetBkColor(-1, 0xFF0000) EndIf Case $check1 If GUICtrlRead($Input3) <> '' And GUICtrlRead($Input3) = GUICtrlRead($Input4) Then $pp = GUICtrlRead($Input3) GUICtrlDelete($popup1) $popup1 = GUICtrlCreateButton("", 100, 194, 25, 17, 0) GUICtrlSetBkColor(-1, 0x00CC00) Else $pp = '' $popup1 = GUICtrlCreateButton("", 100, 194, 25, 17, 0) GUICtrlSetBkColor(-1, 0xFF0000) EndIf Case $alldone If $nn <> '' And $pp <> '' Then ExitLoop Else MsgBox(262144, "ERROR", "Please enter your User Name and Password") EndIf EndSwitch If Not $expanded Then If $nn <> '' And $pp <> '' Then WinMove($Form1, "", 619, 451, 137, 290) EndIf EndIf WEnd GUIDelete($Form1) Return EndFunc ;==>GetUserName 8) Link to comment Share on other sites More sharing options...
xShadowx Posted September 20, 2008 Author Share Posted September 20, 2008 (edited) Thanks mate, I only thing I needed was: GUICtrlCreateLabel("text", 5, 5, 770, 20) GUICtrlSetColor( -1, 0xcolor) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) Thanks for your help. >=-D Edit: Is there a way to make the text bold? Also, is there a way to somehow build the image into the exe, so there is no need for an image outside the program? Like so there is no need for an image in a specific directory? Edited September 20, 2008 by xShadowx Link to comment Share on other sites More sharing options...
rasim Posted September 20, 2008 Share Posted September 20, 2008 xShadowxIs there a way to make the text bold?See a GuiCtrlSetFont() function. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now