incepator Posted November 13, 2012 Share Posted November 13, 2012 I have a problem with GUICtrlCreatePic. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 533, 365, 445, 403) $Button1 = GUICtrlCreateButton("adauga", 8, 8, 75, 25) $Pic1 = GUICtrlCreatePic("G:\Poze\50 Amazing Mix HQ Wallpapers [Set 1]\Mix-Pack-8 (3).jpg", 0, 0, 532, 364, -1, $GUI_WS_EX_PARENTDRAG) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $Pic2 = GUICtrlCreatePic("G:\Poze\50 Amazing Mix HQ Wallpapers [Set 1]\Mix-Pack-8.jpg", 200, 96, 244, 188) EndSwitch WEnd $Button1 is not visible... if press $Button1, not create $Pic2 ... Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 13, 2012 Moderators Share Posted November 13, 2012 incepator,This is all down to how AutoIt deals with the ordering the Pic controls. I have always found it advisable to create all the Pic controls initially and then hide/show them as required. You also need to realise that unless you disable the background Pic control, your button will not work even if it is visible. Basically if both the Pic control and the overlapping button are active then AutoIt does not know which you want to action - and so it actions neither. However, this means that your $GUI_WS_EX_PARENTDRAG style does not work, so we have to get around that as well! All in all this script should do what you want:#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <SendMessage.au3> Global Const $SC_DRAGMOVE = 0xF012 $Form1 = GUICreate("Form1", 533, 365, 445, 403) $Pic1 = GUICtrlCreatePic("Image_Path_1", 0, 0, 532, 364) ;, -1, $GUI_WS_EX_PARENTDRAG) ; No point in using this style GUICtrlSetState(-1, $GUI_DISABLE) $Pic2 = GUICtrlCreatePic("Image_Path_2", 200, 96, 244, 188) GUICtrlSetState(-1, $GUI_HIDE) $Button1 = GUICtrlCreateButton("adauga", 8, 8, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_PRIMARYDOWN _SendMessage($Form1, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0) Case $Button1 GUICtrlSetState($Pic2, $GUI_SHOW) EndSwitch WEndThe Moving and Resizing PopUp GUIs tutorial in the Wiki explains how the code moves the GUI - and offers some other ways to do it as well. All clear? 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...
incepator Posted November 13, 2012 Author Share Posted November 13, 2012 (edited) thank you for reply! I learned something new from you, but the problem is slightly more delicate. to explain: When you press the button pee see will create a list of "GUICtrlCreatePic" depending on how many photos are in a folder, so I do not know how many pictures must put exct to create the first GUICtrlCreatePic. thanks Edited November 13, 2012 by incepator Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 13, 2012 Moderators Share Posted November 13, 2012 incepator,Then I think using a child GUI to display them would be a sensible solution. And if you run out of space you may find my Scrollbars UDF helpful to fit them all in. 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...
incepator Posted November 13, 2012 Author Share Posted November 13, 2012 Melba23,one solution is ...maybe$Pic1 = GUICtrlCreatePic("", 12, 240, 114, 70) GUICtrlSetCursor ($Pic1, 0) GUICtrlSetState(-1, $GUI_DISABLE)andGUICtrlSetImage($Pic1,"pic1") GUICtrlSetState($Pic1,$GUI_ENABLE) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 13, 2012 Moderators Share Posted November 13, 2012 incepator, And how does that help? 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...
incepator Posted November 13, 2012 Author Share Posted November 13, 2012 I found some alternative ... it actually, though not perfect, can achieve a result ... thanks. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 13, 2012 Moderators Share Posted November 13, 2012 incepator, So why not post the code so that others can learn from it as well. 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...
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