AppTux Posted November 11, 2009 Share Posted November 11, 2009 I want more than three pictures in a GUI. When I try this, i only can see three pictures. I have a GUI that contains a minimize and close button and a button. The close and minimize button 're pictures. the bar also. when i click the close button, you have to see an other picture. But not. I only see a white picture, not I want to see. plz help me!! #include <WindowsConstants.au3> #include <GuiConstantsEx.au3> #include <GuiMenu.au3> #include <File.au3> #include <GDIPlus.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $theme[6],$GUI1,$inp,$min,$close,$msg,$cursor _FileReadToArray("Resources\Theme.ini",$theme) $GUI1 = GUICreate("Example", 450,300,-1,-1,$WS_POPUP) GUISetBkColor(0xd8d8d8) GUICtrlCreatePic($theme[2],0,0,450,300) GUICtrlSetState(-1,$GUI_DISABLE) $min = GUICtrlCreatePic($theme[3],375,0,25,18) $close = GUICtrlCreatePic($theme[5],400,0,50,18) $inp = GUICtrlCreateButton("Click on Me!",20,100,200,20) GUISetState() Do $msg = GUIGetMsg() $cursor = GUIGetCursorInfo($GUI1) If $msg = $close Then GUICtrlDelete($close) GUICtrlCreatePic($theme[6],255,0,20,20) Sleep(100) Exit EndIf Until $msg = $GUI_EVENT_CLOSE EndFunc PowerSlide2UnlockiPhone look-a-like program you can use to lock your pc, you can't access your desktop again until the password is entered and the slider slided to the right. (really proud of it)-- After a time AutoIt and Windows, I switched to Mac. Don't expect me to answer anymore. Link to comment Share on other sites More sharing options...
water Posted November 11, 2009 Share Posted November 11, 2009 (edited) Just a quick shot in the dark. What if you add a "GUISetState()" before the Sleep Command and change the sleep to "sleep(2000)" (two seconds) so the picture gets the time to be display. sleep(100) is only a 1/10th of a second. Edited November 11, 2009 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 11, 2009 Moderators Share Posted November 11, 2009 AppTux,First, welcome to the Autoit forums. Your new picture is being created, but is hidden behind the large GUI-sized one - I have had similar problems when adding pic controls after having created the GUI so it was an easy spot. I found that you need to create the picture earlier and hide it - and then show it again when you are ready. This script works for me using graphics from my machine:expandcollapse popup#include <WindowsConstants.au3> #include <GuiConstantsEx.au3> #include <GuiMenu.au3> #include <File.au3> #include <GDIPlus.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $GUI1,$inp,$min,$close,$msg,$cursor, $next _FileReadToArray("Resources\Theme.ini",$theme) $GUI1 = GUICreate("Example", 450,300,-1,-1,$WS_POPUP) GUISetBkColor(0xd8d8d8) GUICtrlCreatePic($theme[2],0,0,450,300) GUICtrlSetState(-1,$GUI_DISABLE) $min = GUICtrlCreatePic($theme[3],375,0,25,18) $close = GUICtrlCreatePic($theme[5],400,0,50,18) $next = GUICtrlCreatePic($theme[6],255,0,40,40) GUICtrlSetState(-1, $GUI_HIDE) $inp = GUICtrlCreateButton("Click on Me!",20,100,200,20) GUISetState() Do $msg = GUIGetMsg() $cursor = GUIGetCursorInfo($GUI1) If $msg = $close Then GUICtrlDelete($close) GUICtrlSetState($next, $GUI_SHOW) Sleep(2000) Exit EndIf Until $msg = $GUI_EVENT_CLOSE EndFuncI increased the Sleep a bit so you can actually see the new graphic before the whole GUI disappears! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
AppTux Posted November 12, 2009 Author Share Posted November 12, 2009 AppTux, First, welcome to the Autoit forums. Your new picture is being created, but is hidden behind the large GUI-sized one - I have had similar problems when adding pic controls after having created the GUI so it was an easy spot. I found that you need to create the picture earlier and hide it - and then show it again when you are ready. This script works for me using graphics from my machine: expandcollapse popup#include <WindowsConstants.au3> #include <GuiConstantsEx.au3> #include <GuiMenu.au3> #include <File.au3> #include <GDIPlus.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $GUI1,$inp,$min,$close,$msg,$cursor, $next _FileReadToArray("Resources\Theme.ini",$theme) $GUI1 = GUICreate("Example", 450,300,-1,-1,$WS_POPUP) GUISetBkColor(0xd8d8d8) GUICtrlCreatePic($theme[2],0,0,450,300) GUICtrlSetState(-1,$GUI_DISABLE) $min = GUICtrlCreatePic($theme[3],375,0,25,18) $close = GUICtrlCreatePic($theme[5],400,0,50,18) $next = GUICtrlCreatePic($theme[6],255,0,40,40) GUICtrlSetState(-1, $GUI_HIDE) $inp = GUICtrlCreateButton("Click on Me!",20,100,200,20) GUISetState() Do $msg = GUIGetMsg() $cursor = GUIGetCursorInfo($GUI1) If $msg = $close Then GUICtrlDelete($close) GUICtrlSetState($next, $GUI_SHOW) Sleep(2000) Exit EndIf Until $msg = $GUI_EVENT_CLOSE EndFunc I increased the Sleep a bit so you can actually see the new graphic before the whole GUI disappears! M23 Thanks, it works very well. also thanks for the welcome this is very useful, also for the minimize button and other things in my GUI AppTux PowerSlide2UnlockiPhone look-a-like program you can use to lock your pc, you can't access your desktop again until the password is entered and the slider slided to the right. (really proud of it)-- After a time AutoIt and Windows, I switched to Mac. Don't expect me to answer anymore. 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