Ronnie126 Posted March 16, 2012 Posted March 16, 2012 Ok, so I have sample code from the help file and it has been slightly modified, one of my questions is to how to get the background picture to be in the background like it's supposed to be. The buttons don't show up. Here's the code; expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Example() ; Example2() ; example 1 Func Example() Local $Button_1, $Button_2, $msg GUICreate("Shutdown Control Center") ; will create a dialog box that when displayed is $MyBackgroundJPG = GUICtrlCreatePic("C:\Users\Ronnie\Pictures\GUIBackground.jpg", 0, 0, 400, 500) Opt("GUICoordMode", 2) $Button_1 = GUICtrlCreateButton("Run Notepad", 10, 30, 100) $Button_2 = GUICtrlCreateButton("Button Test", 0, -1) GUISetState() ; will display an dialog box with 2 button GuiCtrlSetState($MyBackgroundJPG, $GUI_DISABLE) ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 Run('notepad.exe') ; Will Run/Open Notepad Case $msg = $Button_2 MsgBox(0, 'Testing', 'Button 2 was pressed') ; Will demonstrate Button 2 being pressed EndSelect WEnd EndFunc ;==>Example ; example 2 Func Example2() Local $sFile = "" Local $gui = GUICreate("Background", 400, 100) ; background picture GUICtrlCreatePic("C:\Users\Ronnie\Pictures\GUIBackground.jpg", 0, 0, 400, 100) GUISetState(@SW_SHOW) ; transparent MDI child window GUICreate("", 169, 68, 20, 20, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $gui) ; transparent pic GUICtrlCreatePic($sFile, 0, 0, 169, 68) GUISetState(@SW_SHOW) Do Local $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE EndFunc ;==>Example2
UEZ Posted March 16, 2012 Posted March 16, 2012 (edited) The problem is Opt("GUICoordMode", 2).Try this instead.Func Example() ;~ Opt("GUICoordMode", 2) Local $Button_1, $Button_2, $msg GUICreate("Shutdown Control Center") ; will create a dialog box that when displayed is $MyBackgroundJPG = GUICtrlCreatePic("C:UsersRonniePicturesGUIBackground.jpg", 0, 0, 400, 500) GUICtrlSetState(-1, $GUI_DISABLE) $Button_1 = GUICtrlCreateButton("Run Notepad", 10, 30, 100) $Button_2 = GUICtrlCreateButton("Button Test", 200, 30, 100) GUISetState() ; will display an dialog box with 2 button GuiCtrlSetState($MyBackgroundJPG, $GUI_DISABLE) ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 Run('notepad.exe') ; Will Run/Open Notepad Case $msg = $Button_2 MsgBox(0, 'Testing', 'Button 2 was pressed') ; Will demonstrate Button 2 being pressed EndSelect WEnd EndFunc ;==>ExampleBr,UEZ Edited March 16, 2012 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
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